BlobbyTabDlg Class Reference

#include <blobby.h>

Inheritance diagram for BlobbyTabDlg:

DialogTabOp DialogOp Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 BlobbyTabDlg ()
 The Constructor of the DialogTabOp derived class simply sets modality of the dialog, and it's ID.
MsgResult Message (Msg *Message)
 This is the message handler for the BlobbyTabDlg.
void Do (OpDescriptor *)
 Like all Do functions invokes the BlobbyTabDlg.
virtual BOOL RegisterYourPagesInOrderPlease ()
 This virtual function will get called to give you a chance to add pages to your DialogTabOp. This function will usually make multiple calls to AddAPage to register the initial set of pages to be contained in the tab dialog. The pages should all be the same size and be registered in the left to right order in which you wish them to appear.

Static Public Member Functions

static BOOL Init ()
 The standard Init fn for the op.
static OpState GetState (String_256 *, OpDescriptor *)
 The standard GetState fn, does nothing.

Static Public Attributes

static const CDlgMode Mode = MODAL
static const UINT32 IDD = _R(IDD_BLOBBYTABDLG)

Private Member Functions

void HandleCoordsMsg (DialogMsg *Msg)
 All messages generated from the tabbed dialog's page 1 get processed here.
void HandleRadioDazeMsg (DialogMsg *Msg)
 All messages generated from the tabbed dialog's page 2 get processed here.
void HandleConvertMsg (DialogMsg *Msg)
 All messages generated from the tabbed dialog's page 3 get processed here.

Private Attributes

String_256 UnitStrList [9]
UnitType UnitList [9]
UnitType DefaultUnit
UnitType ConvUnit

Detailed Description

Definition at line 378 of file blobby.h.


Constructor & Destructor Documentation

BlobbyTabDlg::BlobbyTabDlg  ) 
 

The Constructor of the DialogTabOp derived class simply sets modality of the dialog, and it's ID.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/11/94

Definition at line 1429 of file blobby.cpp.

01429                           : DialogTabOp(BlobbyTabDlg::IDD, BlobbyTabDlg::Mode)
01430 {
01431 
01432     // Init Internals for conversion page
01433     UnitStrList[0] = String(TEXT("Millimetres"));
01434     UnitStrList[1] = String(TEXT("Centimetres"));
01435     UnitStrList[2] = String(TEXT("Metres"));
01436     UnitStrList[3] = String(TEXT("Inches"));
01437     UnitStrList[4] = String(TEXT("Feet"));
01438     UnitStrList[5] = String(TEXT("Yards"));
01439     UnitStrList[6] = String(TEXT("Points"));
01440     UnitStrList[7] = String(TEXT("Picas"));
01441     UnitStrList[8] = String(TEXT("Millipoints"));
01442 
01443     UnitList[0] = MILLIMETRES;
01444     UnitList[1] = CENTIMETRES;
01445     UnitList[2] = METRES;
01446     UnitList[3] = INCHES;
01447     UnitList[4] = FEET;
01448     UnitList[5] = YARDS;
01449     UnitList[6] = COMP_POINTS;
01450     UnitList[7] = PICAS;
01451     UnitList[8] = MILLIPOINTS;
01452 
01453 }


Member Function Documentation

void BlobbyTabDlg::Do OpDescriptor  )  [virtual]
 

Like all Do functions invokes the BlobbyTabDlg.

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

Errors: -

See also:
-

Reimplemented from Operation.

Definition at line 1830 of file blobby.cpp.

01831 {
01832     // Note: For a real tabbed dialog you would not even think about including an explicit
01833     // string in the dialog would you ?
01834     String_256 Name(_T("Blobby tab dialog"));
01835     SetName(&Name);
01836     BOOL ok = Create(); // Create the TAB dialog please
01837     if (!ok)
01838     {
01839         /*InformError(blobby)*/;    // Display an error if this is a real dialog please
01840         End();
01841     }
01842 }

OpState BlobbyTabDlg::GetState String_256 ,
OpDescriptor
[static]
 

The standard GetState fn, does nothing.

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

Errors: -

See also:
-

Definition at line 1766 of file blobby.cpp.

01767 {
01768     OpState OpSt;
01769     return(OpSt);
01770 }

void BlobbyTabDlg::HandleConvertMsg DialogMsg Msg  )  [private]
 

All messages generated from the tabbed dialog's page 3 get processed here.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/11/94
Parameters:
Msg,: The message sent from page 3 of the dialog [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: - Scope: private

See also:
BlobbyTabDlg::Message

Definition at line 1694 of file blobby.cpp.

01695 {
01696     TalkToPage(_R(IDD_BLOBTAB_PG3));  // The Coords Page identifier
01697     switch(Msg->DlgMsg)
01698     {
01699         case DIM_CREATE:
01700         {
01701             DefaultUnit = INCHES;       // Default unit
01702             ConvUnit = MILLIMETRES;  // Conversion unit
01703 
01704             // Setup combos
01705             for (INT32 i=0; i<9; i++)
01706             {
01707                 SetStringGadgetValue(_R(IDC_TCOMBO3), UnitStrList[i],FALSE,i);
01708                 SetStringGadgetValue(_R(IDC_TCOMBO4), UnitStrList[i],FALSE,i);
01709             }
01710         }
01711         break;
01712         // Init coords controls here
01713         case DIM_SELECTION_CHANGED:
01714         {
01715             if (Msg->GadgetID == _R(IDC_TCOMBO3))
01716             {
01717 //              BOOL Valid=0;
01718                 WORD Index;
01719                 GetValueIndex(_R(IDC_TCOMBO3),&Index);
01720                 if (Index <= 8)
01721                     DefaultUnit = UnitList[Index];
01722 
01723             }
01724             else if (Msg->GadgetID == _R(IDC_TCOMBO4))
01725             {
01726 //              BOOL Valid=0;
01727                 WORD Index;
01728                 GetValueIndex(_R(IDC_TCOMBO4),&Index);
01729                 if (Index <= 8)
01730                     ConvUnit = UnitList[Index];
01731             }
01732         }
01733         break;
01734         case DIM_LFT_BN_CLICKED:
01735         {
01736             if (Msg->GadgetID == _R(IDC_TBUTTON3))
01737             {
01738                 BOOL Valid=0;
01739                 MILLIPOINT Value = GetUnitGadgetValue(_R(IDC_TUNITVAL),DefaultUnit,-10000000,10000000,0,&Valid);
01740                 SetUnitGadgetValue(_R(IDC_TCONVVAL), ConvUnit, Value);
01741             }
01742         }
01743         break;
01744         default: break;
01745     }
01746 }

void BlobbyTabDlg::HandleCoordsMsg DialogMsg Msg  )  [private]
 

All messages generated from the tabbed dialog's page 1 get processed here.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/11/94
Parameters:
Msg,: The message sent from page 1 of the dialog [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: - Scope: private

See also:
BlobbyTabDlg::Message

Definition at line 1562 of file blobby.cpp.

01563 {
01564     TalkToPage(_R(IDD_BLOBTAB_PG1));  // The Coords Page identifier
01565     MILLIPOINT Value = 0;
01566     switch(Msg->DlgMsg)
01567     {
01568         case DIM_CREATE:
01569             // Init coords controls here
01570 
01571             // Set the scrollers range
01572             SetGadgetRange(_R(IDC_TSCROLLBAR1), 10, 100, 10);
01573             SetGadgetRange(_R(IDC_TSCROLLBAR2), 10, 100, 10);
01574 
01575             // Set initial scroll bar positions
01576             SetLongGadgetValue(_R(IDC_TSCROLLBAR1), 60, 10);
01577             SetLongGadgetValue(_R(IDC_TSCROLLBAR2), 60, 10);
01578 
01579             BOOL Valid;
01580             Value = (MILLIPOINT)(GetLongGadgetValue(_R(IDC_TSCROLLBAR1),10,100,0,&Valid)*72000);
01581             SetUnitGadgetValue(_R(IDC_TXVAL), INCHES, Value);
01582             Value = (MILLIPOINT)(GetLongGadgetValue(_R(IDC_TSCROLLBAR2),10,100,0,&Valid)*72000);
01583             SetUnitGadgetValue(_R(IDC_TYVAL), INCHES, Value);
01584             break;
01585         case DIM_SELECTION_CHANGED:
01586             if (Msg->GadgetID == _R(IDC_TSCROLLBAR1))
01587             {
01588                 Value = (MILLIPOINT)(GetLongGadgetValue(_R(IDC_TSCROLLBAR1),10,100,0,&Valid)*72000);
01589                 SetUnitGadgetValue(_R(IDC_TXVAL), INCHES, Value);
01590             } else if (Msg->GadgetID == _R(IDC_TSCROLLBAR2))
01591             {
01592                 Value = (MILLIPOINT)(GetLongGadgetValue(_R(IDC_TSCROLLBAR2),10,100,0,&Valid)*72000);
01593                 SetUnitGadgetValue(_R(IDC_TYVAL), INCHES, Value);
01594             }
01595             break;
01596         default:
01597             break;
01598     }
01599 }

void BlobbyTabDlg::HandleRadioDazeMsg DialogMsg Msg  )  [private]
 

All messages generated from the tabbed dialog's page 2 get processed here.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/11/94
Parameters:
Msg,: The message sent from page 2 of the dialog [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: - Scope: private

See also:
BlobbyTabDlg::Message

Definition at line 1618 of file blobby.cpp.

01619 {
01620     TalkToPage(_R(IDD_BLOBTAB_PG2));  // The Coords Page identifier
01621     switch(Msg->DlgMsg)
01622     {
01623         case DIM_CREATE:
01624             // Init RadioDaze controls here
01625             SetLongGadgetValue(_R(IDC_TRADIO11), TRUE);
01626             SetLongGadgetValue(_R(IDC_TRADIO12), FALSE);
01627             SetLongGadgetValue(_R(IDC_TRADIO13), FALSE);
01628 
01629             SetLongGadgetValue(_R(IDC_TRADIO21), FALSE);
01630             SetLongGadgetValue(_R(IDC_TRADIO22), FALSE);
01631             SetLongGadgetValue(_R(IDC_TRADIO23), TRUE);
01632 
01633             break;
01634         case DIM_LFT_BN_CLICKED:
01635             if (Msg->GadgetID==_R(IDC_TRADIO11))
01636             {
01637                 SetLongGadgetValue(_R(IDC_TRADIO23), TRUE);
01638                 SetLongGadgetValue(_R(IDC_TRADIO21), FALSE);
01639                 SetLongGadgetValue(_R(IDC_TRADIO22), FALSE);
01640             }
01641             else if (Msg->GadgetID==_R(IDC_TRADIO12))
01642             {
01643                 SetLongGadgetValue(_R(IDC_TRADIO22), TRUE);
01644                 SetLongGadgetValue(_R(IDC_TRADIO21), FALSE);
01645                 SetLongGadgetValue(_R(IDC_TRADIO23), FALSE);
01646             }
01647             else if (Msg->GadgetID==_R(IDC_TRADIO13))
01648             {
01649                 SetLongGadgetValue(_R(IDC_TRADIO21), TRUE);
01650                 SetLongGadgetValue(_R(IDC_TRADIO22), FALSE);
01651                 SetLongGadgetValue(_R(IDC_TRADIO23), FALSE);
01652             }
01653             else if (Msg->GadgetID==_R(IDC_TRADIO21))
01654             {
01655                 SetLongGadgetValue(_R(IDC_TRADIO13), TRUE);
01656                 SetLongGadgetValue(_R(IDC_TRADIO11), FALSE);
01657                 SetLongGadgetValue(_R(IDC_TRADIO12), FALSE);
01658             }
01659             else if (Msg->GadgetID==_R(IDC_TRADIO22))
01660             {
01661                 SetLongGadgetValue(_R(IDC_TRADIO12), TRUE);
01662                 SetLongGadgetValue(_R(IDC_TRADIO11), FALSE);
01663                 SetLongGadgetValue(_R(IDC_TRADIO13), FALSE);
01664             }
01665             else if (Msg->GadgetID==_R(IDC_TRADIO23))
01666             {
01667                 SetLongGadgetValue(_R(IDC_TRADIO11), TRUE);
01668                 SetLongGadgetValue(_R(IDC_TRADIO12), FALSE);
01669                 SetLongGadgetValue(_R(IDC_TRADIO13), FALSE);
01670             }
01671             break;
01672         default:
01673             break;
01674     }
01675 }

BOOL BlobbyTabDlg::Init void   )  [static]
 

The standard Init fn for the op.

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

Errors: -

See also:
-

Reimplemented from SimpleCCObject.

Definition at line 1789 of file blobby.cpp.

01790 {
01791 
01792 return (RegisterOpDescriptor(
01793                                 0,
01794                                 _R(IDS_BLOBBYTABDLG),
01795                                 CC_RUNTIME_CLASS(BlobbyTabDlg),
01796                                 OPTOKEN_BLOBBYTABDLG,
01797                                 BlobbyTabDlg::GetState,
01798                                 0,  /* help ID */
01799                                 _R(IDBBL_BLOBBYDLG),
01800                                 0,
01801                                 0,
01802                                 SYSTEMBAR_ILLEGAL,
01803                                 TRUE,
01804                                 FALSE,
01805                                 TRUE,
01806                                 0,
01807                                 0, // One open instance
01808                                 GREY_WHEN_NO_CURRENT_DOC
01809                                 ));
01810 
01811 }

MsgResult BlobbyTabDlg::Message Msg Message  )  [virtual]
 

This is the message handler for the BlobbyTabDlg.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/2/94
Parameters:
Message,: The message [INPUTS]
Returns:
OK Message handled ok (return this even if you don't need to respond to the message).
FAIL Something terrible happened whilst processing the message eg. we ran out of memory. You must set ERROR if you are returning this value.

EAT_MSG The Message was handled ok but don't send it to any more MessageHandlers.

Reimplemented from DialogTabOp.

Definition at line 1479 of file blobby.cpp.

01480 {
01481     if (IS_OUR_DIALOG_MSG(Message))
01482     {
01483         DialogMsg* Msg = ((DialogMsg*) Message);
01484 
01485         BOOL EndDialog = FALSE;     // TRUE if we should quit the dialog
01486         BOOL CommitValues = FALSE;  // TRUE if we should commit the dialog values
01487 
01488         // Determine from what page the message originated
01489         if (Msg->PageID == _R(IDD_BLOBTAB_PG1))
01490         {
01491             HandleCoordsMsg(Msg);
01492         } else if (Msg->PageID == _R(IDD_BLOBTAB_PG2))
01493         {
01494             HandleRadioDazeMsg(Msg);
01495         } else if (Msg->PageID == _R(IDD_BLOBTAB_PG3))
01496         {
01497             HandleConvertMsg(Msg);
01498         } else if (Msg->PageID == 0)
01499         {
01500             // A message generated from the tabbed dialog itself
01501             switch (Msg->DlgMsg)
01502             {
01503                 case DIM_COMMIT:        // Want to commit and quit
01504                     EndDialog = TRUE;
01505                     CommitValues = TRUE;
01506                     break;
01507 
01508                 case DIM_SOFT_COMMIT:   // Want to commit
01509                     CommitValues = TRUE;
01510                     break;
01511 
01512                 case DIM_CANCEL:        // Want to quit
01513                     EndDialog = TRUE;
01514                     break;
01515 
01516                 default:
01517                     break;
01518             }
01519         } else
01520         {
01521             ERROR3("Message from unknown tab dialog page");
01522         }
01523 
01524         // Commit values here
01525         if (CommitValues)
01526         {
01527             TRACE( _T("BlobbyTabDlg::Message - If I wasn't blobby I would commit at this point"));
01528         }
01529 
01530         // End dialog here
01531         if (EndDialog)  // Dialog communication over
01532         {
01533             Close();
01534             End();      // End of dialog
01535         }
01536         return (DLG_EAT_IF_HUNGRY(Msg));   // I return EAT_MSG unless the message needs to be sent to all dialogs
01537     }
01538     return OK;
01539 }

BOOL BlobbyTabDlg::RegisterYourPagesInOrderPlease  )  [virtual]
 

This virtual function will get called to give you a chance to add pages to your DialogTabOp. This function will usually make multiple calls to AddAPage to register the initial set of pages to be contained in the tab dialog. The pages should all be the same size and be registered in the left to right order in which you wish them to appear.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/11/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
return TRUE if all calls to AddAPage returned TRUE
This function get's called directly from the Create method, Don't call it explicitly yourself. If you return FALSE from this method then the Create method will fail.

Returns:
Errors: -
See also:
DialogTabOp::AddPage

DialogOp::Create

Reimplemented from DialogTabOp.

Definition at line 1870 of file blobby.cpp.

01871 {
01872     BOOL ok = AddAPage(_R(IDD_BLOBTAB_PG1)) &&
01873               AddAPage(_R(IDD_BLOBTAB_PG2)) &&
01874               AddAPage(_R(IDD_BLOBTAB_PG3));
01875     return (ok);
01876 }


Member Data Documentation

UnitType BlobbyTabDlg::ConvUnit [private]
 

Definition at line 404 of file blobby.h.

UnitType BlobbyTabDlg::DefaultUnit [private]
 

Definition at line 403 of file blobby.h.

const UINT32 BlobbyTabDlg::IDD = _R(IDD_BLOBBYTABDLG) [static]
 

Definition at line 393 of file blobby.h.

const CDlgMode BlobbyTabDlg::Mode = MODAL [static]
 

Definition at line 390 of file blobby.h.

UnitType BlobbyTabDlg::UnitList[9] [private]
 

Definition at line 402 of file blobby.h.

String_256 BlobbyTabDlg::UnitStrList[9] [private]
 

Definition at line 401 of file blobby.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:51:31 2007 for Camelot by  doxygen 1.4.4