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 » How to load/save a single ControlBar information? Collapse All
Subject Author Date
jun liu May 9, 2005 - 10:30 PM

I

jun liu May 9, 2005 - 10:34 PM

I know how to load and save the all the control bar status in a file by useing the fnction:


  CExtControlBar::ProfileBarStateSerialize(
    ar,    this,    &m_dataFrameWP   );


I just want to load/save a single bar’s state information. How can I do that?


bool wndMsgLog::BarStateSet(eDynamicBarState_t eDBS, bool bShow)
{
 if (!bShow){
  CMemFile f1;
  CArchive ar( &f1, CArchive::store);
  Serialize(ar);
  ar.Close();
  int len;
  len=f1.GetLength();
  smt_setcfg("wndMsgLog","State",(char*)f1.Detach(),len);


 }
 return CExtWndFrm::BarStateSet(eDBS,bShow);
}


 


 


 

jun liu May 9, 2005 - 10:38 PM

Sorry about the last two messages, this message editor is so hard to use!


I know how to load and save the all the control bar status in a file by useing the fnction:



  CExtControlBar::ProfileBarStateSerialize(
    ar,    this,    &m_dataFrameWP   );



I just want to load/save a single bar’s state information. How can I do that?


for example: i wan to save the state information to a string when i try to hide the control bar. this is my code:


bool somecontrolbarwnd::BarStateSet(eDynamicBarState_t eDBS, bool bShow)
{
 if (!bShow){
  CMemFile f1;
  CArchive ar( &f1, CArchive::store);
  Serialize(ar); //??this doesn’t work, which function can let me save the status?
  ar.Close();
  int len;
  len=f1.GetLength();
 SAVECONFIG("State",(char*)f1.Detach(),len);


 }
 return CExtWndFrm::BarStateSet(eDBS,bShow);
}

Technical Support May 11, 2005 - 10:15 AM

The size, position and state of a particular control bar cannot be saved/restored independently. This task is quite complicated because resizable bars are organized into compound layout which consists of container windows of different types. Please let us know details of your task and we will try to advice you an appropriate solution.

jun liu May 12, 2005 - 7:26 AM

Basiclly, I use DynamicControlBar. When I need the bar, I created one, when I don’t need it, I close it.  
Before I close the DynamicControlBar, I want to save the position, size, configures so that the next time I open the window, I can recover most of the status.
The information I want to save should include the position,size etc for all the three status:docked, floated, MDI child.


I have to create and destroy DynamicControlBar because I don’t know how many Bar I need in total. For example: I use ContolBar for User editor. but I may have hunderd User, and I want to edit the 10 most actived user same time----each user take 1 DynamicControlBar.


Thanks for Reply.

Technical Support May 12, 2005 - 9:09 AM

The real solution in this case is simple: do not destroy dynamic bars which may be needed in future -- simply hide them. You can additionally set the CExtControlBar::m_bAppearInDockSiteControlBarPopupMenu property to false so that you will not see the name of a particular control bar in Prof-UIS built-in pop-up menus. Your users will perceive this control bar as it was closed but in fact it is hidden and waiting for when it becomes needed again.