Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » Repaint of application window after loading state of bars from files Collapse All
Subject Author Date
Darius Mikalauskas Mar 24, 2009 - 1:08 AM

Hi,


my application is based on StateIniFile example (I uses version 2.82). It works fine until more than two bars are docked in one vertical column. When for example three CExtResizableDialog windows are docked vertically in one column after load of state from file I get some empty non updated region. Moving of any resizable dialog causes redraw af application window and correct placement of all dialogs. How to make this redraw programatically after load of state.


Thank you in advance. With best regards


Darius

Darius Mikalauskas Mar 25, 2009 - 1:14 AM

Bar state saving and loading are copied from StateIniFile example:


   CFile _file(

   dlg.m_ofn.lpstrFile,

   CFile::modeRead|CFile::shareExclusive

   );

  CArchive ar( &_file, CArchive::load);


  CWinApp * pApp = ::AfxGetApp();

  ASSERT( pApp != NULL );

  ASSERT( pApp->m_pszRegistryKey != NULL );

  ASSERT( pApp->m_pszRegistryKey[0] != _T(’\0’) );

  ASSERT( pApp->m_pszProfileName != NULL );

  ASSERT( pApp->m_pszProfileName[0] != _T(’\0’) );


  ShowWindow( SW_HIDE );

  VERIFY(

   CExtControlBar::ProfileBarStateSerialize(

    ar,

    this,

    &m_dataFrameWP

    )

   );

  VERIFY(

   g_CmdManager->SerializeState(

    pApp->m_pszProfileName,

    ar

    )

   );


  ActivateFrame( SW_SHOW );


 


 


With best regards


Darius

Technical Support Mar 25, 2009 - 11:08 AM

This code snippet is OK. Could you show the source code which docks control bars into one column?

Technical Support Mar 24, 2009 - 9:43 AM

We need to take a look at the main frame’s source code. We suspect the problem is with initialization sequence or bar state loading.

Darius Mikalauskas Mar 25, 2009 - 1:16 AM

Bar state saving and loading are copied from StateIniFile example:


 


 


 CFile _file(

   dlg.m_ofn.lpstrFile,

   CFile::modeRead|CFile::shareExclusive

   );

  CArchive ar( &_file, CArchive::load);


  CWinApp * pApp = ::AfxGetApp();

  ASSERT( pApp != NULL );

  ASSERT( pApp->m_pszRegistryKey != NULL );

  ASSERT( pApp->m_pszRegistryKey[0] != _T(’\0’) );

  ASSERT( pApp->m_pszProfileName != NULL );

  ASSERT( pApp->m_pszProfileName[0] != _T(’\0’) );


  ShowWindow( SW_HIDE );

  VERIFY(

   CExtControlBar::ProfileBarStateSerialize(

    ar,

    this,

    &m_dataFrameWP

    )

   );

  VERIFY(

   g_CmdManager->SerializeState(

    pApp->m_pszProfileName,

    ar

    )

   );


  ActivateFrame( SW_SHOW );


 


With best regards

Darius

Technical Support Mar 25, 2009 - 11:09 AM

This code snippet is OK. Could you show the source code which docks control bars into one column?

Darius Mikalauskas Mar 25, 2009 - 1:41 PM

Hi,


control bars are moved manually with mouse. I put three bars to one column, three bars to next column and save state to file. After state is restored from file after ActivateFrame command application window is displayed with wronly repositioned two top bars (in both columns).


After any movement of other bars (again with mouse), wrongly displayed bars are redrawed correctly exactly like before load of state from file.


 


With best regards


Darius

Technical Support Mar 26, 2009 - 6:02 AM

A quick question: do the dialog template resources used for dialog windows inside bars have the both WS_CLIPSIBLINGS | WS_CLIPCHILDREN styles set on?

Darius Mikalauskas Mar 26, 2009 - 6:42 AM

Yes they have.


 


Darius

Technical Support Mar 26, 2009 - 1:45 PM

Could you modify the StateInFile sample application so it reproduces this problem and send it to us?