Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. SetScrollSizes.

SetScrollSizes.

Scheduled Pinned Locked Moved C / C++ / MFC
help
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 953354
    wrote on last edited by
    #1

    Hi, My code in OnInitialUpdate is sizeTotal.cx = 1000; sizeTotal.cy = 300; // TODO: calculate the total size of this view SetScrollSizes(MM_TEXT,sizeTotal); Instead of passing the hardcoded values 1000,300 i want them to change them dynamically. eg: sizeTotal.cx = m_nHeight; sizeTotal.cy = m_nWidth; This gives me an assertion error. How can this be achieved. Thanks and regards, Salil.

    J 1 Reply Last reply
    0
    • U User 953354

      Hi, My code in OnInitialUpdate is sizeTotal.cx = 1000; sizeTotal.cy = 300; // TODO: calculate the total size of this view SetScrollSizes(MM_TEXT,sizeTotal); Instead of passing the hardcoded values 1000,300 i want them to change them dynamically. eg: sizeTotal.cx = m_nHeight; sizeTotal.cy = m_nWidth; This gives me an assertion error. How can this be achieved. Thanks and regards, Salil.

      J Offline
      J Offline
      John R Shaw
      wrote on last edited by
      #2

      I can only remember an assertion error occuring when some thing other than MM_TEXT is passed as the first argument. The following is from a small paint program I wrote:

      void CSPaintView::UpdateScrollSizes()
      {
      CSize sizeTotal = m_Grid.GetDrawSize();
      CSize sizePage(sizeTotal.cx >> 1, sizeTotal.cy >> 1);
      sizeTotal.cx += sizeTotal.cx >> 1;
      sizeTotal.cy += sizeTotal.cy >> 1;

      CSize sizeLine(10 \* m\_Grid.GetMag(), 10 \* m\_Grid.GetMag());
      
      SetScrollSizes(MM\_TEXT, sizeTotal, sizeDefault, sizeLine);
      

      }

      This function is called from multiple locations in my view class functions and has always worked fine. Just single step into the SetScrollSizes function and look at the place where the assertion occurs (assuming CScrollView derive class). INTP

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups