DialogBarOp Class Reference

#include <bars.h>

Inheritance diagram for DialogBarOp:

DialogOp Operation MessageHandler ListItem CCObject SimpleCCObject InformationBarOp SystemBarOp BevelInfoBarOp BezToolInfoBarOp BlankInfoBarOp BlendInfoBarOp ContourInfoBarOp FreeHandInfoBarOp GradInfoBarOp GridInfoBarOp LiveEffectsInfoBarOp MouldInfoBarOp PenToolInfoBarOp QuickShapeBaseInfoBarOp SelectorInfoBarOp SliceInfoBarOp TextInfoBarOp TranspInfoBarOp ZoomInfoBarOp List of all members.

Public Member Functions

 DialogBarOp (CCRuntimeClass *Class=NULL)
 Constructor.
 DialogBarOp (String_32 &NewName, CCRuntimeClass *Class=NULL)
 Constructor.
 DialogBarOp (UINT32 StringID, CCRuntimeClass *Class=NULL)
 Constructor.
 ~DialogBarOp ()
 Destructor.
void DialogBarOpInit (String_32 &NewName)
 Common routine called by all Constructors.
BOOL IsABar ()
virtual MsgResult Message (Msg *Msg)
 The default DialogBarOp Message handler This should be overriden for InformationBar DialogBarOps which will have a structure identical to DialogOps.
virtual void UpdateState ()
 This function gets called during idle time. It calls the GetState fn associated with each controls OpDescriptor. The button gets disabled if the operation is not executable.
BOOL IsAllBarsOp ()
 

LISTPOS AddBarItem (BarItem *pBarItem)
 Adding a bar item to a bar.
BarItemRemoveBarItem (LISTPOS here)
 Removes the bar item from the list of bar items n the bar. This does NOT delete the item, or any memory associated with it. It is just delinked.
BarItemRemoveBarItem (BarItem *thisItem)
 Removes the bar item from the list of bar items n the bar. This does NOT delete the item, or any memory associated with it. It is just delinked.
void MoveBarItem (LISTPOS here, LISTPOS newpos)
 Moves the bar item at 'here' to a new position in the bar. All items that were at positions from 'newpos' onwards before the call and shuffled along one position to accommodate the move.
BOOL DeleteBarItem (CWindowID WinID)
 Removes and deletes all bar items attached to this bar. It's main function is for tidying up after errors during the reconstruction of the bars system when the tokenised ASCII file is read in.
BarItemGetBarItem (CWindowID WinID)
 Removes and deletes all bar items attached to this bar. It's main function is for tidying up after errors during the reconstruction of the bars system when the tokenised ASCII file is read in.
void InsertItemAfter (LISTPOS here, BarItem *thisItem)
 
BOOL HideDisableGadgetAndResuffleBar (CWindowID WinID)
 This function is the saviour of camelots GUI infobars - several of which have become too crowded, and as such; their controls no longer fit into the 'static' docked infobar. The function hides the requested control and automatically resuffles those controls that occur after it. For example: Combo1, Combo2, Combo3; call on Combo1 gives: Combo2, Combo3 If you are calling this operation - you MUST ensure that the infobar (which is WinID's parent) has been handled within winoil.cpp. Refer (basebar2.cpp) line 1311 for the code that MUST be checked/edited (or search on DialogBarOp::HideDisableGadgetAndResuffleBar). If you want to see an example of how to use this function correctly, consult tool.cpp - since this is the first place the function was used within camelot. TIP: I would recommend that you hide the controls in a left to right order (i.e. leftmost first).
BOOL ShowEnableGadgetAndResuffleBar (CWindowID WinID)
 Does the opposite of BOOL DialogBarOp::HideDisableGadgetAndResuffleBar (CWindowID WinID).
BOOL ResetHiddenGadgetStates ()
 This function is required to fix the errors that originate on 'dynamic' infobars when we change to another tool - or drag the infobar into a floating one; and then make it dockable again. The problems result from the fact that we need to reset our visibility flags (in these cases) in order for the HideDisableGadgetAndResuffleBar and ShowDisableGadgetAndResuffleBar to do their stuff correctly. This function handles this ....
void DeleteAllBarItems ()
 Removes and deletes all bar items attached to this bar. It's main function is for tidying up after errors during the reconstruction of the bars system when the tokenised ASCII file is read in.
BOOL IsListEmpty ()
 

BarItemGetPtrBarItem (LISTPOS here)
 Allows you to get your mits on a bar item.
BarItemGetPtrBarNext (BarItem *ThisItem)
 Allows you to get your mits on a bar item.
BarItemGetPtrBarPrev (BarItem *ThisItem)
 Allows you to get your mits on a bar item.
BarItemInsertItemBefore (BarItem *here, BarItem *newItem)
 Allows you to insert a bar item.
BarItemGetPtrBarHead ()
 Allows you to get your mits on a bar item.
DWORD GetNumBarItems () const
 You can find out just how many pesky bar items are in this bar with this call.
BOOL Read (CCLexFile &file)
 Read the dialog bar from the file in a tokenized form.
virtual BOOL Write (CCLexFile &file)
 Write the dialog bar to the file in a tokenized form.
virtual BOOL Read (LoadRegistryEntries &Loader)
 Read the dialog bar or super gallery definition from the registry.
virtual BOOL Write (SaveRegistryEntries &Saver)
 Write the dialog bar to the registry.
DockBarType GetDockBarType ()
void SetDockBarType (DockBarType DockValue)
UINT32 GetSlot ()
void SetSlot (UINT32 SlotNum)
UINT32 GetOffset ()
void SetOffset (INT32 OffsetValue)
wxPoint GetFloatingCPoint ()
void SetFloatingCPoint (wxPoint &Pos)
wxRect GetBarRect ()
void SetBarRect (wxRect &Rect)
String_32GetName ()
void SetName (String_32 &str)
 "I name this bar..."
void SetCurrentOrientation (Orientation BarDirection)
 To inform the DialogBarOp of its current orientation (horizontal or vertical).
BOOL IsHorizontal ()
void Delete ()
 The DialogBarOp Delete method Deletes the window and resets WindowID to NULL.
UINT32 GetUniqueID ()
 This function returns a uniqueID i.e. highest + 1.
virtual BOOL AllowMulSelInListBox ()
 Linked heavilly with the BaseBar class and the creation of list boxes associated with the dialog bar op of a gallery. This gives the derived dialog bar op the opportunity to have a say to whether the list box should allow multiple selection or not. This base version always returns TRUE.

Static Public Member Functions

static void UpdateStateOfAllBars ()
 This static function gets called during idle time If the system state has changed then it updates the enabled state of all visible DialogBars.
static BOOL Init ()
 Adds the operation to the list of all known operations.
static OpState GetState (String_256 *Description, OpDescriptor *)
 Find out the state of the operation at the specific time.
static BOOL WriteBars (CCLexFile &file)
 Writes all the bars in tokenized form to the given file.
static BOOL WriteNamedBars (String_256 FileName)
 writes current bars set up to *.ini file
static BOOL WriteBarsToFile (CCLexFile &file)
 Writes the entire kernel's bar representation to the given file. It is written in an ASCII tokenized form so that CCLexFile can be used to read the file back in when reconstructing the bars system.
static BOOL WriteDockingBarsToFile (CCLexFile &file)
 Writes the persistant docking data retrieved from the docking system.
static BOOL WriteWorkSpaceInfoToFile (CCLexFile &file)
 Writes workspace data to ini file ( Full Screen Mode etc..).
static BOOL ReadBarsFromFile (CCLexFile &file, BarCreate &BarCreate, UINT32 *pNumBarsRead=NULL, UINT32 *pNumDockingBarsRead=NULL)
 Reads the bars represented in the given file. It reads the file in an ASCII tokenized form using CCLexFile::GetSimpleToken(), and reconstructs the bars defined.
static BOOL MakeControlBank ()
 Build a control bar that contains all the controls defined in the bars.ini resource.
static DialogBarOpFindDialogBarOp (String_32 &DialogBarOpName, INT32 limit=-1)
 Looks for a given DialogBarOp by using its name.
static DialogBarOpFindDialogBarOp (UINT_PTR WinID)
 Looks for a given DialogBarOp by using its name.
static BOOL AddOpToAll (OpDescriptor *pHorzOpDesc, OpDescriptor *pVertOpDesc)
 DEAD.
static UINT32 FindUniqueBarNumber ()
 

static BOOL LoadBars ()
 loads in, and then creates initial bars This function must get called after the docking bars have been created
static BOOL LoadDefaultBars ()
 loads in, and then creates initial bars This function must get called after the docking bars have been created
static BOOL WipeBarFiles ()
 Wipes bar config files from disc - called if the user selects default settings.
static BOOL LoadNamedBars (String_256 FileName)
 loads in, and then creates initial bars This function must get called after the docking bars have been created
static void SetSystemStateChanged (BOOL State=TRUE)
 Constructor.
static BOOL ShouldUpdateBarState ()
 


Static Public Attributes

static DialogBarOpAllBarsOp = NULL

Static Protected Member Functions

static BOOL WriteBarsToRegistry (HKEY hSubKey)
 The constructor The destructor Find out the size of controls used by all bars docked with this docking bar Sets the size of controls used by all bars docked with this docking bar Writes a tokenized form of the docking bar to the given file Writes all the docking bars in tokenized form to the given file Asks each relevent kernel bar representation to write its definition out. Each bar is written into a numbered section which is a sub-section of the supplied key. The numbering is 1..n. Each bar should write out some standard named sections and then write out any bar items as separate numbered lines into their section. The helper class SaveRegistryEntries can be used to handle this automatically.
static BOOL WriteWorkSpaceInfoToRegistry (HKEY hSubKey)
 Writes workspace data to registry ( Full Screen Mode etc..).
static BOOL WriteDockingBarsToRegistry (HKEY hSubKey)
 Writes the persistant docking data retrieved from the docking system.
static BOOL ReadBarsFromRegistry (HKEY hSubKey)
 Reads the bar definitions from the specified section in the registry. Each bar is written into a numbered section which is a sub-section of the supplied key. The numbering is 1..n. So we need to search for these numbered sections until we fail to find one.
static BOOL ReadWorkSpaceInfoFromRegistry (HKEY hSubKey)
 Reads workspace data from the registry ( Full Screen Mode etc..).
static BOOL ReadDockingBarsFromRegistry (HKEY hSubKey)
 Reads in the persistant docking data retrieved from the docking system.
static BOOL WipeRegistrySettingsForBar (TCHAR *pBarName)
 Wipes bar registry settings for the named section. Called if the user selects default settings.
static BOOL ReadRegistryBarsVersion ()
static BOOL LoadNamedBarFile (String_256 FileName, BOOL *Opened)
 loads in bar defs from *.confile. This function must get called after the docking bars have been created
static BOOL LoadBarsFromRes ()
 loads in bars from the bars.ini resource that's bound into the exe. This function must get called after the docking bars have been created
static BOOL ReadResVersion ()
 Reads Revision number of bars.ini checks whether this is the same as the version in prefs.
static BOOL CreateBars ()
 Creates initial bars loaded in using either LoadBarsFromFile or LoadBarsFromRes. Only DialogBarOps are created. All derived classes are ignored, such as InformationBarOps and SystemBarOps. This function must get called after the docking bars have been created.
static BOOL SetValidPath (String_256 Filename)
 looks for bars.con files first in prefs path then in windows dir if found sets ValidPath and return TRUE else return FALSE
static BOOL FlushUpToToken (CCLexFile &file, TokenIndex Token)
 This reads the file until it finds the token given, or it finds the end of file. This is used to skip over bar definitions that ReadBarsFromFile() knows it can ignore, e.g. old versions of bars, extinct class names, etc.

Protected Attributes

DockBarType Dock
UINT32 Slot
INT32 Offset
wxPoint FloatPos
wxRect BarRect
BOOL InitiallyVisible
List BarItemList

Static Protected Attributes

static PathName ValidPath

Private Attributes

String_32 Name
Orientation BarOrientation

Static Private Attributes

static BOOL SystemStateChanged = TRUE

Detailed Description

Definition at line 582 of file bars.h.


Constructor & Destructor Documentation

DialogBarOp::DialogBarOp CCRuntimeClass Class = NULL  ) 
 

Constructor.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/3/94
Parameters:
Class = the message handler class list to add this object to. [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 304 of file bars.cpp.

00304                                              : DialogOp(_R(IDD_BLANKBAR), MODELESS,0,SAFECLASS(Class))
00305 {
00306     String_32 str = String_32(_R(IDS_K_BARS_NONAME));
00307     DialogBarOpInit(str);
00308 }

DialogBarOp::DialogBarOp String_32 NewName,
CCRuntimeClass Class = NULL
 

Constructor.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/3/94
Parameters:
NewName = Name of this bar [INPUTS] Class = the message handler class list to add this object to.
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 350 of file bars.cpp.

00350                                                                 : DialogOp(_R(IDD_BLANKBAR), MODELESS,0,SAFECLASS(Class))
00351 {
00352     DialogBarOpInit(NewName);
00353 }

DialogBarOp::DialogBarOp UINT32  StringID,
CCRuntimeClass Class = NULL
 

Constructor.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/3/94
Parameters:
StringID = ID of name of the dialog bar op. [INPUTS] Class = the message handler class list to add this object to.
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 327 of file bars.cpp.

00327                                                               : DialogOp(_R(IDD_BLANKBAR), MODELESS,0,SAFECLASS(Class))
00328 {
00329     String_32 str = String_32(StringID);
00330     DialogBarOpInit(str);
00331 }

DialogBarOp::~DialogBarOp  ) 
 

Destructor.

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

Errors: -

See also:
-

Definition at line 402 of file bars.cpp.

00403 {
00404 //  if (IsUserName("MarkN")) TRACE( _T("~DialogBarOp\n"));
00405     DeleteAllBarItems();
00406 }


Member Function Documentation

LISTPOS DialogBarOp::AddBarItem BarItem pBarItem  ) 
 

Adding a bar item to a bar.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/3/94
Parameters:
pBarItem = ptr to a bar item to add to the dialog bar [INPUTS]
- [OUTPUTS]
Returns:
The position of the new bar item in the bar

Errors: -

See also:
-

Definition at line 424 of file bars.cpp.

00425 {
00426     BarItemList.AddTail(pBarItem);
00427     return (BarItemList.FindPosition(pBarItem));
00428 }

BOOL DialogBarOp::AddOpToAll OpDescriptor pHorzOpDesc,
OpDescriptor pVertOpDesc
[static]
 

DEAD.

static BOOL DialogBarOp::AddOpToAll( OpDescriptor* pHorzOpDesc, OpDescriptor* pVertOpDesc = NULL)

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/5/95
Parameters:
Pointer to the Horz OpDescriptor to connect to a bar [INPUTS] Pointer to the Vert OpDescriptor to connect to a bar (should be NULL if Vert is same as Horz op desc)
- [OUTPUTS]
Returns:
TRUE if added OK. FALSE otherwise.

Errors: -

See also:
-

Definition at line 5737 of file bars.cpp.

05738 {
05739     return FALSE;
05740 }

BOOL DialogBarOp::AllowMulSelInListBox  )  [virtual]
 

Linked heavilly with the BaseBar class and the creation of list boxes associated with the dialog bar op of a gallery. This gives the derived dialog bar op the opportunity to have a say to whether the list box should allow multiple selection or not. This base version always returns TRUE.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the list box associated with the dialog bar op should allow multiple selection or not

Errors: -

See also:
-

Definition at line 5691 of file bars.cpp.

05692 {
05693     return TRUE;
05694 }

BOOL DialogBarOp::CreateBars  )  [static, protected]
 

Creates initial bars loaded in using either LoadBarsFromFile or LoadBarsFromRes. Only DialogBarOps are created. All derived classes are ignored, such as InformationBarOps and SystemBarOps. This function must get called after the docking bars have been created.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/4/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if successful

Errors: -

See also:
LoadBarsFromFile,LoadBarsFromRes,LoadBars

Definition at line 3127 of file bars.cpp.

03128 {
03129 
03130 
03131     List*       pList = MessageHandler::GetClassList(CC_RUNTIME_CLASS(DialogBarOp));
03132     ListItem*   pListItem = pList->GetHead();
03133 //  ListItem*   pListItem = pList->GetTail();
03134 
03135     OILFixedDockingBar::DoNotTidyBars ();
03136 
03137     while (pListItem != NULL)
03138     {
03139         DialogBarOp* pDialogBarOp = (DialogBarOp*)pListItem;
03140 
03141         
03142 //      TCHAR* p=pDialogBarOp->Name;
03143 
03144         if  (   (pDialogBarOp->GetRuntimeClass() == CC_RUNTIME_CLASS(DialogBarOp))
03145     /*      #ifdef _DEBUG
03146             ||  (   pDialogBarOp->GetRuntimeClass() == CC_RUNTIME_CLASS(SystemBarOp)
03147                     && ShowSystemBars
03148                 )
03149             #endif*/
03150             || (pDialogBarOp->IsKindOf(CC_RUNTIME_CLASS(SuperGallery)))
03151             )                                   
03152         {
03153             if ((pDialogBarOp->GetNumBarItems() > 0) && pDialogBarOp->InitiallyVisible)
03154             {
03155                 if (!pDialogBarOp->Create())
03156                 {
03157                     ENSURE(FALSE, "Failed to create bar"); 
03158                     return FALSE; 
03159                 }
03160             }
03161         }
03162 //      pListItem = pList->GetPrev(pListItem);
03163         pListItem = pList->GetNext(pListItem);
03164     }
03165 
03166     OILFixedDockingBar::AllowTidyBars ();
03167 
03168     return TRUE; 
03169 }

void DialogBarOp::Delete  ) 
 

The DialogBarOp Delete method Deletes the window and resets WindowID to NULL.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com> (using Simon code)
Date:
29/4/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented in InformationBarOp.

Definition at line 2561 of file bars.cpp.

02562 {
02563     if (WindowID != NULL)
02564     {
02565         PORTNOTETRACE("dialog","Warning - DialogBarOp::Delete called and disabled");
02566 #ifndef EXCLUDE_FROM_XARALX
02567         KernelBarPos*   pKernelBarPos;
02568         DockBarType     Dock;
02569 
02570         if (GetMainFrame()->GetBarPosInfo(WindowID,&Dock,&pKernelBarPos))
02571         {
02572             SetDockBarType(Dock);
02573             if (Dock == DOCKBAR_FLOAT)
02574                 SetFloatingCPoint(wxPoint(pKernelBarPos->x,pKernelBarPos->y));
02575             else
02576             {
02577                 SetSlot(pKernelBarPos->Slot);
02578                 SetOffset(pKernelBarPos->Position);
02579             }
02580         }
02581 #endif
02582         CCamApp::GetDlgManager()->Delete(WindowID, this);
02583         WindowID = NULL;
02584     }
02585 }

void DialogBarOp::DeleteAllBarItems  ) 
 

Removes and deletes all bar items attached to this bar. It's main function is for tidying up after errors during the reconstruction of the bars system when the tokenised ASCII file is read in.

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

Errors: -

See also:
-

Definition at line 961 of file bars.cpp.

00962 {
00963 //  if (IsUserName("MarkN")) TRACE( _T("DeleteAllBarItems()\n"));
00964 
00965     BarItem* pNextBarItem = (BarItem*) BarItemList.GetHead();
00966     BarItem* pThisBarItem;
00967     
00968     while (pNextBarItem != NULL)
00969     {
00970         pThisBarItem = pNextBarItem;
00971         pNextBarItem = (BarItem*) BarItemList.GetNext(pThisBarItem);
00972 
00973         BarItemList.RemoveItem(pThisBarItem);
00974         //if (IsUserName("MarkN")) TRACE( _T("deleting pThisBarItem (%p)\n"),pThisBarItem);
00975         delete pThisBarItem;
00976     }
00977 }

BOOL DialogBarOp::DeleteBarItem CWindowID  WinID  ) 
 

Removes and deletes all bar items attached to this bar. It's main function is for tidying up after errors during the reconstruction of the bars system when the tokenised ASCII file is read in.

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

Errors: -

See also:
-

Definition at line 1042 of file bars.cpp.

01043 {
01044 //  if (IsUserName("MarkN")) TRACE( _T("DeleteAllBarItems()\n"));
01045 
01046     BarItem* pNextBarItem = (BarItem*) BarItemList.GetHead();
01047     BarItem* pThisBarItem;
01048     
01049     while (pNextBarItem != NULL)
01050     {
01051         pThisBarItem = pNextBarItem;
01052         pNextBarItem = (BarItem*) BarItemList.GetNext(pThisBarItem);
01053         if (pThisBarItem->IsKindOf(CC_RUNTIME_CLASS(BarControl)))
01054         {
01055             BarControl* BarCtrl = (BarControl*)pThisBarItem;
01056             if(WinID == BarCtrl->GetWinID())
01057             {
01058                 BarItemList.RemoveItem(pThisBarItem);
01059                 delete pThisBarItem;
01060                 return TRUE;
01061             }
01062         }
01063     }
01064     
01065     ERROR2(FALSE,"Can't find bar item to delete");
01066 }

void DialogBarOp::DialogBarOpInit String_32 NewName  ) 
 

Common routine called by all Constructors.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/4/94
Parameters:
NewName = Name of this bar [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 371 of file bars.cpp.

00372 {
00373     Name = NewName;
00374     Dock = DOCKBAR_TOP;
00375     Slot = 0;
00376     Offset = 0;
00377     FloatPos = wxPoint(100,100);
00378     BarRect = wxRect(0, 0, 0, 0);
00379     BarOrientation = Horizontal; 
00380     InitiallyVisible = TRUE;
00381 
00382     // Report new bar to any dialog ops...
00383     BROADCAST_TO_CLASS( BarMsg(BAR_CREATE,this), DialogOp );
00384 }

DialogBarOp * DialogBarOp::FindDialogBarOp UINT_PTR  ID  )  [static]
 

Looks for a given DialogBarOp by using its name.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/4/94
Parameters:
DialogBarOpName = Name of op to find [INPUTS]
- [OUTPUTS]
Returns:
ptr to DialogBarOp NULL is returned if not found

Errors: -

See also:
-

Definition at line 3270 of file bars.cpp.

03271 {
03272     List*           pList = MessageHandler::GetClassList(CC_RUNTIME_CLASS(DialogBarOp));
03273     DialogBarOp*    pDialogBarOp = (DialogBarOp*)pList->GetHead();
03274 
03275     while (pDialogBarOp != NULL)
03276     {
03277         if (pDialogBarOp->WindowID == (CWindowID)ID)
03278             return (pDialogBarOp);
03279 
03280         pDialogBarOp = (DialogBarOp*)pList->GetNext(pDialogBarOp);
03281     }
03282 
03283     return NULL;
03284 } 

DialogBarOp * DialogBarOp::FindDialogBarOp String_32 DialogBarOpName,
INT32  limit = -1
[static]
 

Looks for a given DialogBarOp by using its name.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/4/94
Parameters:
DialogBarOpName = Name of op to find [INPUTS] limit if -1 then it means use the whole name for the check (default) if > 0 then limit the check to the limit number of characters
- [OUTPUTS]
Returns:
ptr to DialogBarOp NULL is returned if not found

Errors: -

See also:
-

Definition at line 3189 of file bars.cpp.

03190 {
03191     List*           pList = MessageHandler::GetClassList(CC_RUNTIME_CLASS(DialogBarOp));
03192     DialogBarOp*    pDialogBarOp = (DialogBarOp*)pList->GetHead();
03193     
03194     String_32       OpName;
03195     while (pDialogBarOp != NULL)
03196     {
03197         if (limit > 0)
03198             pDialogBarOp->Name.Left(&OpName, limit);
03199         else
03200             OpName = pDialogBarOp->Name;
03201         
03202         if (OpName == DialogBarOpName)
03203             return (pDialogBarOp);
03204 
03205         pDialogBarOp = (DialogBarOp*)pList->GetNext(pDialogBarOp);
03206     }
03207 
03208     return NULL;
03209 }

UINT32 DialogBarOp::FindUniqueBarNumber  )  [static]
 

static UINT32 DialogBarOp::FindUniqueBarNumber()

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/4/94
Parameters:
DialogBarOpName = Name of op to find [INPUTS]
- [OUTPUTS]
Returns:
unique nuber to put in new bar name

Errors: -

See also:
-

Definition at line 3227 of file bars.cpp.

03228 {
03229     List*           pList = MessageHandler::GetClassList(CC_RUNTIME_CLASS(DialogBarOp));
03230     DialogBarOp*    pDialogBarOp = (DialogBarOp*)pList->GetHead();
03231     UINT32 Highest = 0;
03232     String_32 name;
03233     String_32 prefix;
03234     String_32 number;
03235     while (pDialogBarOp != NULL)
03236     {
03237         name = pDialogBarOp->GetName();
03238         name.Left(&prefix,3);
03239         if(!prefix.CompareTo(_T("Bar")))
03240         {   
03241             //Highest ++;
03242             name.Right(&number,name.Length()-4);
03243             TCHAR *pszMark;
03244             UINT32 SoFar = camStrtol( (const TCHAR *)number, &pszMark, 10 );
03245             if(SoFar>=Highest)
03246                 Highest = SoFar;
03247         }
03248         pDialogBarOp = (DialogBarOp*)pList->GetNext(pDialogBarOp);
03249     }
03250 
03251     return Highest+1;
03252 } 

BOOL DialogBarOp::FlushUpToToken CCLexFile file,
TokenIndex  Token
[static, protected]
 

This reads the file until it finds the token given, or it finds the end of file. This is used to skip over bar definitions that ReadBarsFromFile() knows it can ignore, e.g. old versions of bars, extinct class names, etc.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/95
Parameters:
file = file to read bar tokens from [INPUTS] Token= token that we want to read up to.
- [OUTPUTS]
Returns:
TRUE = Able to read upto token OR end of file FALSE = Failed to read the bar info without error. The error cases are - 1. File error (e.g. file open, disk fault, etc)

Errors: -

See also:
DialogBarOp::ReadBarsFromFile()

Definition at line 5364 of file bars.cpp.

05365 {
05366     BOOL finished = FALSE,ok = TRUE;
05367 
05368     // Get ptr to token buffer. Guaranteed not to move until next
05369     // InitLexer() call
05370     const TCHAR* TokenBuf = file.GetTokenBuf();
05371 
05372     while (!finished && ok)
05373     {
05374         ok = file.GetSimpleToken();
05375 
05376         if (ok)
05377             finished = (file.GetTokenType() == TOKEN_EOF) || (FindToken(TokenBuf) == Token);
05378     }
05379 
05380     return ok;
05381 }

BarItem * DialogBarOp::GetBarItem CWindowID  WinID  ) 
 

Removes and deletes all bar items attached to this bar. It's main function is for tidying up after errors during the reconstruction of the bars system when the tokenised ASCII file is read in.

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

Errors: -

See also:
-

Definition at line 997 of file bars.cpp.

00998 {
00999 //  if (IsUserName("MarkN")) TRACE( _T("DeleteAllBarItems()\n"));
01000 
01001     BarItem* pNextBarItem = (BarItem*) BarItemList.GetHead();
01002     BarItem* pThisBarItem;
01003     
01004     while (pNextBarItem != NULL)
01005     {
01006         pThisBarItem = pNextBarItem;
01007         pNextBarItem = (BarItem*) BarItemList.GetNext(pThisBarItem);
01008         if (pThisBarItem->IsKindOf(CC_RUNTIME_CLASS(BarControl)))
01009         {
01010             BarControl* BarCtrl = (BarControl*)pThisBarItem;
01011             if(WinID == BarCtrl->GetWinID())
01012             {
01013                 return pThisBarItem;
01014             }
01015         }
01016     }
01017 
01018     return (NULL);
01019     
01020 //  ERROR2(NULL,"Can't find bar item");
01021 }

wxRect DialogBarOp::GetBarRect  )  [inline]
 

Definition at line 678 of file bars.h.

00678 { return BarRect; }

DockBarType DialogBarOp::GetDockBarType  )  [inline]
 

Definition at line 670 of file bars.h.

00670 { return Dock; }

wxPoint DialogBarOp::GetFloatingCPoint  )  [inline]
 

Definition at line 676 of file bars.h.

00676 { return FloatPos; }

String_32& DialogBarOp::GetName  )  [inline]
 

Definition at line 680 of file bars.h.

00680 { return Name; }

DWORD DialogBarOp::GetNumBarItems  )  const
 

You can find out just how many pesky bar items are in this bar with this call.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/3/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Num bar items in the bar

Errors: -

See also:
-

Definition at line 1214 of file bars.cpp.

01215 {
01216     return (BarItemList.GetCount());
01217 }

UINT32 DialogBarOp::GetOffset  )  [inline]
 

Definition at line 674 of file bars.h.

00674 { return Offset; }

BarItem * DialogBarOp::GetPtrBarHead  ) 
 

Allows you to get your mits on a bar item.

Author:
Chris_Parks (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/5/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
ptr to the head of baritem list

Errors: Debug build - An ENSURE failure if a bar item is not found. Retail build - NULL is returned if a bar item is not found.

See also:
-

Definition at line 1107 of file bars.cpp.

01108 {
01109     BarItem* pBarItem = (BarItem*) BarItemList.GetHead();
01110     //ENSURE(pBarItem != NULL,"Couldn't get ptr bar item. Item not found.");
01111 
01112     return (pBarItem);
01113 }

BarItem * DialogBarOp::GetPtrBarItem LISTPOS  here  ) 
 

Allows you to get your mits on a bar item.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/3/94
Parameters:
here = position of the bar item. [INPUTS]
- [OUTPUTS]
Returns:
ptr to the bar item at position 'here'

Errors: Debug build - An ENSURE failure if a bar item is not found. Retail build - NULL is returned if a bar item is not found.

See also:
-

Definition at line 1083 of file bars.cpp.

01084 {
01085     BarItem* pBarItem = (BarItem*) BarItemList.FindItem(here);
01086     ENSURE(pBarItem != NULL,"Couldn't get ptr bar item. Item not found.");
01087     
01088     return (pBarItem);
01089 }

BarItem * DialogBarOp::GetPtrBarNext BarItem ThisItem  ) 
 

Allows you to get your mits on a bar item.

Author:
Chris_Parks (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/5/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
ptr to the next item in baritem list

Errors: -

See also:
-

Definition at line 1150 of file bars.cpp.

01151 {
01152     BarItem* pBarItem = (BarItem*) BarItemList.GetNext(ThisItem);
01153     return (pBarItem);
01154 }

BarItem * DialogBarOp::GetPtrBarPrev BarItem ThisItem  ) 
 

Allows you to get your mits on a bar item.

Author:
Chris_Parks (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/5/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
ptr to the previous item in baritem list

Errors: -

See also:
-

Definition at line 1170 of file bars.cpp.

01171 {
01172     BarItem* pBarItem = (BarItem*) BarItemList.GetPrev(ThisItem);
01173     return (pBarItem);
01174 }

UINT32 DialogBarOp::GetSlot  )  [inline]
 

Definition at line 672 of file bars.h.

00672 { return Slot; }

OpState DialogBarOp::GetState String_256 Description,
OpDescriptor
[static]
 

Find out the state of the operation at the specific time.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/2/94
Parameters:
Description - GetState fills this string with an approriate description [OUTPUTS] of the current state of the push tool
Returns:
The state of the operation, so that menu items (ticks and greying can be done properly

Definition at line 2163 of file bars.cpp.

02164 {
02165     OpState State;
02166     
02167     return State;
02168 }

UINT32 DialogBarOp::GetUniqueID  ) 
 

This function returns a uniqueID i.e. highest + 1.

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

Errors: -

See also:
DialogBarOp::UpdateStateOfAllBars

Definition at line 2395 of file bars.cpp.

02396 {
02397     UINT32 HighestSoFar = 100;
02398     UINT32 FoundID =0;
02399 
02400     if (WindowID != NULL)  // If the WindowID is NULL then the DialogBar has not been created
02401     {
02402         for (BarItem* CurrentBarItem = (BarItem*)BarItemList.GetHead();
02403                  CurrentBarItem != NULL; 
02404                  CurrentBarItem = (BarItem*)BarItemList.GetNext( (ListItem*)CurrentBarItem ))
02405         {
02406             if (CurrentBarItem->IsKindOf(CC_RUNTIME_CLASS(BarControl)))
02407             {
02408                 BarControl* BarCtrl = (BarControl*)CurrentBarItem;
02409                 FoundID = BarCtrl->GetUniqueGadgetID();
02410                 if(FoundID >HighestSoFar)
02411                     HighestSoFar = FoundID;                 
02412                 
02413             }
02414         }
02415     } 
02416     return HighestSoFar + 1;
02417 }

BOOL DialogBarOp::HideDisableGadgetAndResuffleBar CWindowID  WinID  ) 
 

This function is the saviour of camelots GUI infobars - several of which have become too crowded, and as such; their controls no longer fit into the 'static' docked infobar. The function hides the requested control and automatically resuffles those controls that occur after it. For example: Combo1, Combo2, Combo3; call on Combo1 gives: Combo2, Combo3 If you are calling this operation - you MUST ensure that the infobar (which is WinID's parent) has been handled within winoil.cpp. Refer (basebar2.cpp) line 1311 for the code that MUST be checked/edited (or search on