ToolbarDlg Class Reference

#include <tooldlg.h>

Inheritance diagram for ToolbarDlg:

DialogOp Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 ToolbarDlg ()
 ToolbarDlg constructor. Creates a non-undoable operation.
 ~ToolbarDlg ()
 ToolbarDlg destructor sets CurrentToolbarDlg to NULL.
void Do (OpDescriptor *)
 Creates then opens the dialog in response to a request from the user.
BOOL Create ()
 ToolbarDlg create method.
virtual MsgResult Message (Msg *Message)
 Handles all the Toolbar dialog's messages.
void ShowToolbarList ()
 Shows Toolbar info in the Toolbars... dialog. Ignores all SystemBarOps and all InformationBarOps. Adds one line specifically to cover all InformationBarOps.
void ShowToolbarSizes ()
 Shows Toolbar info in the Toolbars... dialog.

Static Public Member Functions

static BOOL Init ()
 ToolbarDlg Init method.
static OpState GetState (String_256 *, OpDescriptor *)
 ToolbarDlg GetState method.
static ToolbarDlgGetToolbarDlg ()
 Make a new toolbar...

Static Public Attributes

static const INT32 IDD = _R(IDD_TOOLBARS)
static const CDlgMode Mode = MODELESS

Private Member Functions

BOOL InitDialog ()
 Sets initial dialog values.
void DeleteSelectedBar ()
 Delete the Bar that is currently selected in the bar listbox.
void TakeToolbarDetails ()
 Take current state from the Toolbars... dialog.
void NewToolbar ()
 Make a new toolbar...
void GetSelectedBarName (String_32 *Result)
 Get the selected item's name.
BOOL CanDeleteSelection ()
 


Static Private Attributes

static ToolbarDlgCurrentToolbarDlg = NULL
static String_16 InfoBarName
static String_16 ControlBankName

Detailed Description

Definition at line 130 of file tooldlg.h.


Constructor & Destructor Documentation

ToolbarDlg::ToolbarDlg  ) 
 

ToolbarDlg constructor. Creates a non-undoable operation.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/03/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 163 of file tooldlg.cpp.

00163                       : DialogOp(ToolbarDlg::IDD, ToolbarDlg::Mode) 
00164 {
00165     CurrentToolbarDlg = this;
00166 }

ToolbarDlg::~ToolbarDlg  ) 
 

ToolbarDlg destructor sets CurrentToolbarDlg to NULL.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/03/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 184 of file tooldlg.cpp.

00185 {
00186     CurrentToolbarDlg = NULL;
00187 }


Member Function Documentation

BOOL ToolbarDlg::CanDeleteSelection  )  [private]
 

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/8/96
Returns:
TRUE if it is safe to delete the current selection

Definition at line 735 of file tooldlg.cpp.

00736 {
00737     String_32 BarName;
00738     GetSelectedBarName(&BarName);
00739 
00740     if (BarName == String_8(TEXT("")))      // No selection to delete
00741         return(FALSE);
00742 
00743     if (BarName == InfoBarName)             // Don't delete InfoBar
00744         return(FALSE);
00745 
00746     if (BarName == ControlBankName)         // Don't delete button palette
00747         return(FALSE);
00748 
00749     return(TRUE);
00750 }

BOOL ToolbarDlg::Create void   )  [virtual]
 

ToolbarDlg create method.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/03/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if successful, else FALSE

Errors: -

See also:
-

Reimplemented from DialogOp.

Definition at line 526 of file tooldlg.cpp.

00527 {                            
00528     if (DialogOp::Create())
00529     { 
00530         // Set the initial control values 
00531         InitDialog();
00532         return TRUE; 
00533     }
00534     else
00535     {
00536         return FALSE; 
00537     }
00538 }

void ToolbarDlg::DeleteSelectedBar  )  [private]
 

Delete the Bar that is currently selected in the bar listbox.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
06/04/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 769 of file tooldlg.cpp.

00770 {
00771     // we can't delete the control bank !!
00772     if (!CanDeleteSelection())
00773         return;
00774 
00775     String_32 BarName;
00776     GetSelectedBarName(&BarName);
00777 
00778     // If nothing is selected, we can't do anything
00779     if (BarName == String_8(TEXT("")))
00780         return;
00781     
00782     // we can't delete the infoobar
00783     if (BarName == String_32(TEXT("Infobar")))
00784         return;
00785 
00786     DialogBarOp* pBar = DialogBarOp::FindDialogBarOp(BarName);
00787 
00788     ENSURE(pBar,"Cannot find named bar in TakeToolbarDetails");
00789 
00790     // If bar is of correct type then adjust its visibility according to the
00791     // check mark...
00792     if ( !( pBar->IsKindOf(CC_RUNTIME_CLASS(SystemBarOp)) ||
00793             pBar->IsKindOf(CC_RUNTIME_CLASS(InformationBarOp))
00794            )
00795         )
00796     {
00797         pBar->Delete();
00798         pBar->End();
00799         ShowToolbarList();
00800     }
00801 }

void ToolbarDlg::Do OpDescriptor  )  [virtual]
 

Creates then opens the dialog in response to a request from the user.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/03/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from Operation.

Definition at line 558 of file tooldlg.cpp.

00559 {
00560     if (Create())
00561     {
00562         Open();
00563     }
00564     else              // Could not create 
00565     {
00566         InformError();
00567         End();         // End the operation
00568     }
00569 }

void ToolbarDlg::GetSelectedBarName String_32 Result  )  [private]
 

Get the selected item's name.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/8/96
Parameters:
Result - Will be filled in witht he name of the selected bar [OUTPUTS]

Definition at line 202 of file tooldlg.cpp.

00203 {
00204     ERROR3IF(Result == NULL, "Illegal NULL param");
00205     *Result = TEXT("");
00206 
00207     CCustomList* pListGadget = CCustomList::GetGadget(GetReadWriteWindowID(), _R(IDC_BARLIST));
00208     if (pListGadget == NULL)
00209         return;
00210 
00211     INT32 SelItem = pListGadget->GetSelectedItemIndex();
00212 
00213     if (SelItem >= 0)
00214         pListGadget->GetItemString(*Result, SelItem, 1);
00215 }

OpState ToolbarDlg::GetState String_256 ,
OpDescriptor
[static]
 

ToolbarDlg GetState method.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/03/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 428 of file tooldlg.cpp.

00429 {    
00430     OpState OpSt;
00431     return(OpSt);
00432 }

ToolbarDlg * ToolbarDlg::GetToolbarDlg  )  [static]
 

Make a new toolbar...

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/04/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 982 of file tooldlg.cpp.

00983 {
00984     return(CurrentToolbarDlg);
00985 }

BOOL ToolbarDlg::Init void   )  [static]
 

ToolbarDlg Init method.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/03/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from SimpleCCObject.

Definition at line 452 of file tooldlg.cpp.

00453 {
00454     BOOL InitOK;
00455 
00456     // Initialise the contents of the static InfoBarName variable here...
00457     String_16 Blobby(_R(IDS_INFOBARNAME));
00458     InfoBarName = Blobby;
00459 
00460     String_16 Noel(_R(IDS_CONTROLBANKNAME));
00461     ControlBankName = Noel;
00462 
00463     InitOK = RegisterOpDescriptor(
00464                                 0,  /* Tool ID */
00465                                 _R(IDS_TOOLBARS_DLG),
00466                                 CC_RUNTIME_CLASS(ToolbarDlg),
00467                                 OPTOKEN_TOOLBARDLG,
00468                                 ToolbarDlg::GetState,
00469                                 0,                  /* help ID */
00470                                 0,                  /* bubble help ID _R(IDBBL_LAYERDLG), */
00471                                 _R(IDB_WINDOWTOOLBARS), /* resource ID */
00472                                 0,                  /* control ID */
00473                                 SYSTEMBAR_ILLEGAL,              // Bar ID
00474                                 FALSE,                          // Recieve system messages
00475                                 FALSE,                          // Smart duplicate operation
00476                                 TRUE,                           // Clean operation
00477                                 0,                              // No vertical counterpart
00478                                 _R(IDS_BARSINFO_ONE)                // String for one copy only
00479                                 
00480                                 )
00481             && RegisterOpDescriptor(
00482                                 0,
00483                                 _R(IDS_TOOLBARNAME_DLG),
00484                                 CC_RUNTIME_CLASS(ToolnameDlg),
00485                                 OPTOKEN_TOOLBARNAMEDLG,
00486                                 ToolnameDlg::GetState,
00487                                 0,  /* help ID */
00488                                 0,  /* bubble help ID _R(IDBBL_LAYERDLG), */
00489                                 0   /* bitmap ID */
00490                                 )
00491             && RegisterOpDescriptor(
00492                                 0,
00493                                 _R(IDS_CUSTOMIZE_BAR_DLG),
00494                                 CC_RUNTIME_CLASS(CustomizeBarDlg),
00495                                 OPTOKEN_CUSTOMIZEBARDLG,
00496                                 CustomizeBarDlg::GetState,
00497                                 0,  /* help ID */
00498                                 0,  /* bubble help ID _R(IDBBL_LAYERDLG), */
00499                                 0   /* bitmap ID */
00500                                 )
00501 
00502             ;
00503 
00504     return (InitOK);
00505 }

BOOL ToolbarDlg::InitDialog  )  [private]
 

Sets initial dialog values.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/03/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 589 of file tooldlg.cpp.

00590 {
00591     // Make the OK button dual function
00592 //  DualFunctionButton(IDOK);
00593 
00594     ShowToolbarList();
00595     ShowToolbarSizes();
00596 
00597     return TRUE;
00598 }

MsgResult ToolbarDlg::Message Msg Message  )  [virtual]
 

Handles all the Toolbar dialog's messages.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/03/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from DialogOp.

Definition at line 234 of file tooldlg.cpp.

00235 {
00236     if (IS_OUR_DIALOG_MSG(Message))
00237     {
00238         DialogMsg* Msg = (DialogMsg*)Message;
00239         BOOL EndDialog = FALSE;
00240 
00241         switch (Msg->DlgMsg)
00242         {
00243             case DIM_CANCEL:
00244             case DIM_COMMIT:
00245                 // Cancel all changes the user wants to make to toolbars...
00246                 EndDialog = TRUE;
00247             break;
00248     
00249             case DIM_SELECTION_CHANGED:
00250             case DIM_SELECTION_CHANGED_COMMIT:
00251                 TakeToolbarDetails();
00252                 break;
00253     
00254             case DIM_LFT_BN_CLICKED:
00255             {   // A control in the Toolbars... dialog has been clicked...
00256                 CMainFrame* pFrame = GetMainFrame();
00257                 BOOL    check;
00258                 BOOL    VV;
00259                 switch (Msg->GadgetID)
00260                 {
00261                     case _R(IDC_BIGALL):
00262                         // Select all the large buttons...
00263                         SetLongGadgetValue(_R(IDC_BIGTOP),1);
00264                         SetLongGadgetValue(_R(IDC_BIGLEFT),1);
00265                         SetLongGadgetValue(_R(IDC_BIGRIGHT),1);
00266                         SetLongGadgetValue(_R(IDC_BIGBOTTOM),1);
00267                         SetLongGadgetValue(_R(IDC_BIGFLOAT),1);
00268                         TakeToolbarDetails();
00269                     break;
00270 
00271                     case _R(IDC_BIGNONE):
00272                         // Deselect all the large buttons...
00273                         SetLongGadgetValue(_R(IDC_BIGTOP),0);
00274                         SetLongGadgetValue(_R(IDC_BIGLEFT),0);
00275                         SetLongGadgetValue(_R(IDC_BIGRIGHT),0);
00276                         SetLongGadgetValue(_R(IDC_BIGBOTTOM),0);
00277                         SetLongGadgetValue(_R(IDC_BIGFLOAT),0);
00278                         TakeToolbarDetails();
00279                     break;
00280 
00281                     case _R(IDC_NEWBAR):
00282                         NewToolbar();
00283                         break;
00284 
00285                     case _R(IDC_BIGTOP):
00286                         check = (BOOL)GetLongGadgetValue(_R(IDC_BIGTOP),0,1,_R(IDS_PHILS_EXAMPLE),&VV);
00287                         pFrame->GetDockBar(DOCKBAR_TOP)->SetBigControlState(check);
00288                         break;
00289                     case _R(IDC_BIGLEFT):
00290                         check = (BOOL)GetLongGadgetValue(_R(IDC_BIGLEFT),0,1,_R(IDS_PHILS_EXAMPLE),&VV);
00291                         pFrame->GetDockBar(DOCKBAR_LEFT)->SetBigControlState(check);
00292                         break;
00293                     case _R(IDC_BIGRIGHT):
00294                         check = (BOOL)GetLongGadgetValue(_R(IDC_BIGRIGHT),0,1,_R(IDS_PHILS_EXAMPLE),&VV);
00295                         pFrame->GetDockBar(DOCKBAR_RIGHT)->SetBigControlState(check);
00296                         break;
00297                     case _R(IDC_BIGBOTTOM):
00298                         check = (BOOL)GetLongGadgetValue(_R(IDC_BIGBOTTOM),0,1,_R(IDS_PHILS_EXAMPLE),&VV);
00299                         pFrame->GetDockBar(DOCKBAR_BOTTOM)->SetBigControlState(check);
00300                         break;
00301                     case _R(IDC_BIGFLOAT):  
00302                         check = (BOOL)GetLongGadgetValue(_R(IDC_BIGFLOAT),0,1,_R(IDS_PHILS_EXAMPLE),&VV);
00303                         pFrame->GetDockBar(DOCKBAR_FLOAT)->SetBigControlState(check);
00304                         break;
00305                     
00306                 
00307                     case _R(IDC_DELETEBAR):     
00308                     {   
00309                         String_32 BarName;
00310                         GetSelectedBarName(&BarName);
00311 
00312                         if (BarName != String_8(TEXT("")))
00313                         {
00314                             // we can't delete the infoobar
00315                             if(BarName == String_32(TEXT("Infobar")))
00316                             {
00317                                 InformWarning(_R(IDS_CANTDELETEINFOBAR),_R(IDS_OK));
00318                                 break;
00319                             }
00320 
00321                             INT32 ButtonPressed = 1;
00322                             ButtonPressed = InformWarning(_R(IDS_WARNDELETEBAR), _R(IDS_OK),_R(IDS_CANCEL));
00323                             Error::ClearError();
00324                             if (ButtonPressed ==  1)
00325                                 DeleteSelectedBar();
00326                         }
00327                         break;  
00328                     }
00329 
00330                     case _R(IDC_RESETBARS):     
00331                     {   
00332                         INT32 ButtonPressed = 1;                        
00333                         ButtonPressed = InformWarning(_R(IDS_WARNRESETBARS), _R(IDS_OK),_R(IDS_CANCEL));
00334                         Error::ClearError();
00335 
00336                         if(ButtonPressed ==  1)
00337                         {
00338                             Progress::Start(FALSE);
00339                             // lock the window to avoid untidy layout recalcs
00340                             ::LockWindowUpdate(GetMainFrame()->GetSafeHwnd());
00341 
00342                             // tell the mainframe we are changing modes - this prevents
00343                             // some unnecessary work
00344                             GetMainFrame()->SetChangingMode(TRUE);
00345 
00346                             // kill all bars ( except infobar at the mo..)
00347                             BROADCAST_TO_CLASS(DialogMsg(NULL, DIM_BAR_DEATH, NULL ),DialogBarOp);
00348                             // hide the info bar
00349                             InformationBarOp::SetVisibility(FALSE,TRUE);
00350 
00351                             DialogBarOp::WipeBarFiles();
00352 
00353                             DialogBarOp::LoadDefaultBars();
00354                             
00355                             // force the info bar to the correct visible state
00356                             InformationBarOp::SetVisibility(InformationBarOp::IsVisible(),TRUE);
00357                             // All clear to Mainframe
00358                             GetMainFrame()->SetChangingMode(FALSE);
00359 
00360                             // Make sure everything is positioned correctly
00361                             GetMainFrame()->RecalcLayout();
00362 
00363                             // Now handle the toolbar ....
00364                             GetMainFrame ()->SetToolbarCreated (TRUE);
00365                             GetMainFrame ()->RelocateToolbar ();
00366 
00367                             // and unlock and show the window
00368                             ::LockWindowUpdate(NULL);
00369                             ShowToolbarList();
00370                             ShowToolbarSizes();
00371                             Progress::Stop();
00372                         }
00373                         break;          
00374                     }
00375                 }
00376                 break;
00377             }
00378         }
00379 
00380         if (EndDialog)  // Dialog communication over
00381         {
00382 
00383             Close();    // Close the dialog
00384             End();      // Destroy dialog
00385             return(OK); // After destroying this object, it's very dangerous to call base class!
00386         }
00387     }
00388     else if ( MESSAGE_IS_A(Message,BarMsg) )
00389     {
00390         switch ( ((BarMsg*)Message)->Reason )
00391         {
00392             case BAR_CHANGESTATE:
00393                 // A bar simply became horizontal, vertical or floating and we don't care
00394                 // about that so do nothing.
00395                 break;
00396 
00397             default:
00398                 // In most cases of BarMsg we want to show the user what happened...
00399                 ShowToolbarList();      // Show changes in bars to user
00400                                         // Note: it would be more optimal to use the pointer
00401                                         // to the bar that comes with this message to just
00402                                         // alter that item in the list.
00403                 break;
00404         }
00405     }
00406 
00407     return DialogOp::Message(Message);
00408 }

void ToolbarDlg::NewToolbar  )  [private]
 

Make a new toolbar...

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/04/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 954 of file tooldlg.cpp.

00955 {
00956     // Invoke the new toolbar name operation
00957     // Obtain a pointer to the op descriptor for the new toolbar name operation
00958     OpDescriptor* pOpDesc =
00959         OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(ToolnameDlg));
00960     ENSURE(pOpDesc,"Can't find ToolnameDlg Op.");
00961     // Invoke the operation.
00962     pOpDesc->Invoke();
00963 }

void ToolbarDlg::ShowToolbarList  ) 
 

Shows Toolbar info in the Toolbars... dialog. Ignores all SystemBarOps and all InformationBarOps. Adds one line specifically to cover all InformationBarOps.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/04/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 620 of file tooldlg.cpp.

00621 {
00622     if (!WindowID)
00623         return;
00624 
00625     // set the custom list gadget 
00626     CCustomList* pListGadget = CCustomList::GetGadget(GetReadWriteWindowID(), _R(IDC_BARLIST));
00627     if(!pListGadget)
00628     {
00629         ERROR2RAW("No list gadget");
00630         return;
00631     }
00632     pListGadget->SetColumnWidth(0,GetSystemMetrics(SM_CXMENUCHECK) + 10);
00633 
00634     CMainFrame* pFrame = GetMainFrame();
00635     ERROR3IF(pFrame == NULL, "Can't find Main Frame in ShowToolBarList");
00636 
00637     if(pFrame->IsChangingViewMode())
00638         return ;
00639 
00640     // Fetch the names and states of all defined bars...
00641     List* pBarList = MessageHandler::GetClassList(CC_RUNTIME_CLASS(DialogBarOp));
00642     ENSURE(pBarList,"Can't find list of DialogBarOps in ShowToolBarList");
00643 
00644     // Delete any existing list items...
00645     pListGadget->DeleteAllItems();
00646 
00647     // Add names of all bars to the list...
00648     // First do the infobar...
00649     pListGadget->AddItem(InfoBarName);
00650     pListGadget->SetSwitchState(InformationBarOp::IsVisible(), (pListGadget->GetItemCount() - 1), 0);
00651 
00652     // Scan the list of all barops and add the names of those which should be shown
00653     // to the user to the scrollable list.
00654     DialogBarOp* pBar = (DialogBarOp*)pBarList->GetHead();
00655     
00656     BOOL FoundControlBank = FALSE;
00657     BOOL ControlBankVisible = FALSE;
00658     while (pBar)
00659     {
00660         // Show any bar that's NOT a system bar and NOT an information bar
00661         // and NOT a Super Gallery put the Controlbank at the end
00662         if ( IS_A(pBar,DialogBarOp) )
00663         {
00664             // Put its name in the list
00665             String_32 BarName = pBar->GetName();
00666             if (BarName != ControlBankName)
00667             {   
00668                 pListGadget->AddItem(BarName);
00669                 pListGadget->SetSwitchState(pBar->IsVisible(), (pListGadget->GetItemCount() - 1), 0);
00670             }
00671             else
00672             {
00673                 FoundControlBank = TRUE;
00674                 ControlBankVisible = pBar->IsVisible();
00675             }
00676         }
00677         pBar = (DialogBarOp*)pBarList->GetNext(pBar);
00678     }
00679     
00680     if (FoundControlBank)
00681     {
00682         pListGadget->AddItem(ControlBankName);
00683         pListGadget->SetSwitchState(ControlBankVisible, (pListGadget->GetItemCount() - 1), 0);
00684     }
00685 }

void ToolbarDlg::ShowToolbarSizes  ) 
 

Shows Toolbar info in the Toolbars... dialog.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/04/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 704 of file tooldlg.cpp.

00705 {
00706     CMainFrame* pFrame = GetMainFrame();
00707     ENSURE(pFrame,"Can't find Main Frame in ShowToolBarSizes");
00708 
00709     // Only attempt to redisplay things if the toolbars dlg exists...
00710     if (WindowID)
00711     {
00712         // Fetch the states of all the docking bars...
00713         SetLongGadgetValue(_R(IDC_BIGTOP),      (INT32) pFrame->GetDockBar(DOCKBAR_TOP)->IsBigControls());
00714         SetLongGadgetValue(_R(IDC_BIGLEFT),     (INT32) pFrame->GetDockBar(DOCKBAR_LEFT)->IsBigControls());
00715         SetLongGadgetValue(_R(IDC_BIGRIGHT),    (INT32) pFrame->GetDockBar(DOCKBAR_RIGHT)->IsBigControls());
00716         SetLongGadgetValue(_R(IDC_BIGBOTTOM),   (INT32) pFrame->GetDockBar(DOCKBAR_BOTTOM)->IsBigControls());
00717         SetLongGadgetValue(_R(IDC_BIGFLOAT),    (INT32) pFrame->GetDockBar(DOCKBAR_FLOAT)->IsBigControls());
00718     }
00719 }

void ToolbarDlg::TakeToolbarDetails  )  [private]
 

Take current state from the Toolbars... dialog.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
06/04/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 820 of file tooldlg.cpp.

00821 {
00822     EnableGadget(_R(IDC_DELETEBAR), CanDeleteSelection());
00823 
00824     CMainFrame* pFrame = GetMainFrame();
00825 
00826     BOOL    check;
00827     BOOL    VV;
00828 
00829     check = (BOOL)GetLongGadgetValue(_R(IDC_BIGTOP),0,1,_R(IDS_PHILS_EXAMPLE),&VV);
00830     pFrame->GetDockBar(DOCKBAR_TOP)->SetBigControlState(check);
00831 
00832     check = (BOOL)GetLongGadgetValue(_R(IDC_BIGLEFT),0,1,_R(IDS_PHILS_EXAMPLE),&VV);
00833     pFrame->GetDockBar(DOCKBAR_LEFT)->SetBigControlState(check);
00834 
00835     check = (BOOL)GetLongGadgetValue(_R(IDC_BIGRIGHT),0,1,_R(IDS_PHILS_EXAMPLE),&VV);
00836     pFrame->GetDockBar(DOCKBAR_RIGHT)->SetBigControlState(check);
00837 
00838     check = (BOOL)GetLongGadgetValue(_R(IDC_BIGBOTTOM),0,1,_R(IDS_PHILS_EXAMPLE),&VV);
00839     pFrame->GetDockBar(DOCKBAR_BOTTOM)->SetBigControlState(check);
00840 
00841     check = (BOOL)GetLongGadgetValue(_R(IDC_BIGFLOAT),0,1,_R(IDS_PHILS_EXAMPLE),&VV);
00842     pFrame->GetDockBar(DOCKBAR_FLOAT)->SetBigControlState(check);
00843 
00844 
00845     CCustomList* pListGadget = CCustomList::GetGadget(GetReadWriteWindowID(), _R(IDC_BARLIST));
00846     if (pListGadget == NULL)
00847         return;
00848     
00849     // Adjust the visibility of the bars...
00850     INT32 listitem = 0;
00851     INT32 listcount = pListGadget->GetItemCount();
00852     String_32 BarName;
00853         
00854     // variables control the dynamic relocation of the 'floating' toolbar ....
00855 //  INT32 ToolbarIndex = -1;
00856 //  BOOL BeenHidden = FALSE;
00857 //  BOOL ToolbarCurrentState = FALSE;
00858     
00859     while (listitem < listcount)
00860     {
00861         // Find bar by name...
00862         pListGadget->GetItemString(BarName, listitem, 1);
00863 
00864         // If name is "Infobar" deal with it specially...
00865         if (BarName == InfoBarName)
00866             InformationBarOp::SetVisibility(pListGadget->GetSwitchState(listitem, 0));
00867         else if (BarName == String_32 (TEXT ("Toolbar")))
00868         {
00869             // do special stuff now ....
00870 
00871             DialogBarOp* pBar = DialogBarOp::FindDialogBarOp(BarName);
00872             ERROR3IF(pBar == NULL, "Cannot find named bar in TakeToolbarDetails");
00873 
00874             // If bar is of correct type then adjust its visibility according to the
00875             // check mark...
00876             if (!pBar->IsKindOf(CC_RUNTIME_CLASS(SystemBarOp)) ||
00877                 !pBar->IsKindOf(CC_RUNTIME_CLASS(InformationBarOp)) )
00878             {
00879                 //ToolbarIndex = listitem;
00880                 
00881                 BOOL CurrentState = pBar->IsVisible ();
00882                 //ToolbarCurrentState = CurrentState;
00883                 pBar->SetVisibility(pListGadget->GetSwitchState(listitem, 0));
00884 
00885                 if (pListGadget->GetSwitchState(listitem, 0) != CurrentState)
00886                 {   
00887                     if (pListGadget->GetSwitchState(listitem, 0))
00888                     {
00889                         GetMainFrame ()->SetToolbarCreated (TRUE);
00890                         GetMainFrame ()->RelocateToolbar ();
00891                     }
00892                     else
00893                     {
00894                         // so that we can lock out the toolbar 'onmove' and 'onsize' code
00895                         // from being executed when there is no toolbar
00896                         GetMainFrame ()->SetToolbarCreated (FALSE);
00897                     }
00898                 }
00899             //  else
00900             //  {
00901             //      BeenHidden = TRUE;
00902             //  }
00903             }
00904         }
00905         else
00906         {
00907             // Look for the named bar in the barops list...
00908             DialogBarOp* pBar = DialogBarOp::FindDialogBarOp(BarName);
00909             ERROR3IF(pBar == NULL, "Cannot find named bar in TakeToolbarDetails");
00910 
00911             // If bar is of correct type then adjust its visibility according to the
00912             // check mark...
00913             if (!pBar->IsKindOf(CC_RUNTIME_CLASS(SystemBarOp)) ||
00914                 !pBar->IsKindOf(CC_RUNTIME_CLASS(InformationBarOp)) )
00915             {
00916                 pBar->SetVisibility(pListGadget->GetSwitchState(listitem, 0));
00917             }
00918         }
00919 
00920         listitem++;
00921     }
00922 
00923     // dynamically reposition the toolbar when the above options are changed ....
00924     
00925 /*  if ((ToolbarIndex != -1) && (!BeenHidden))
00926     {
00927         if (pListGadget->GetSwitchState(ToolbarIndex, 0) != ToolbarCurrentState)
00928         if (pListGadget->GetSwitchState(ToolbarIndex, 0))
00929         {
00930             GetMainFrame ()->SetToolbarCreated (TRUE);
00931             GetMainFrame ()->RelocateToolbar ();
00932         }
00933     }*/
00934 }


Member Data Documentation

String_16 ToolbarDlg::ControlBankName [static, private]
 

Definition at line 164 of file tooldlg.h.

ToolbarDlg * ToolbarDlg::CurrentToolbarDlg = NULL [static, private]
 

Definition at line 162 of file tooldlg.h.

const INT32 ToolbarDlg::IDD = _R(IDD_TOOLBARS) [static]
 

Definition at line 150 of file tooldlg.h.

String_16 ToolbarDlg::InfoBarName [static, private]
 

Definition at line 163 of file tooldlg.h.

const CDlgMode ToolbarDlg::Mode = MODELESS [static]
 

Definition at line 151 of file tooldlg.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:01:59 2007 for Camelot by  doxygen 1.4.4