BlobbyDlg Class Reference

#include <blobby.h>

Inheritance diagram for BlobbyDlg:

DialogOp Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 BlobbyDlg ()
MsgResult Message (Msg *Message)
void Do (OpDescriptor *)
 This function should be over-ridden to perform an operation without passing a parameter.
BOOL Create ()
 The create method reserves everything needed to guarantee that the dialog will appear. It returns FALSE if it fails. If any dialog merging was specified (by providing a non-zero value for SubDialogID in the call to the DialogOp constructor) then it will be carried out when this function is called.

Static Public Member Functions

static BOOL Init ()
 Declares a preference that allows you to clear memory in delete().
static OpState GetState (String_256 *, OpDescriptor *)

Public Attributes

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

Static Public Attributes

static const UINT32 IDD = _R(IDD_BLOBBYDLG)
static const CDlgMode Mode = MODELESS

Detailed Description

Definition at line 326 of file blobby.h.


Constructor & Destructor Documentation

BlobbyDlg::BlobbyDlg  ) 
 

Definition at line 991 of file blobby.cpp.

00991                     : DialogOp(BlobbyDlg::IDD, BlobbyDlg::Mode)
00992 {
00993 }


Member Function Documentation

BOOL BlobbyDlg::Create void   )  [virtual]
 

The create method reserves everything needed to guarantee that the dialog will appear. It returns FALSE if it fails. If any dialog merging was specified (by providing a non-zero value for SubDialogID in the call to the DialogOp constructor) then it will be carried out when this function is called.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/8/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if all resources to create the dialog can be successfully allocated. FALSE otherwise

Errors: If the resources cannot be allocated then ERRORIF is called with a Dialog creation failed error message.

See also:
-

Reimplemented from DialogOp.

Definition at line 1349 of file blobby.cpp.

01350 {
01351     if (DialogOp::Create())
01352     {
01353         SetGadgetRange(_R(IDC_SCROLLBAR1), /*10*/ 0, 100, 10);
01354         SetGadgetRange(_R(IDC_SCROLLBAR2), /*10*/ 0, 100, 10);
01355 
01356         //DualFunctionButton(IDOK);
01357         SetEditGadgetType(_R(IDC_UNITVAL), UNIT_NUMERIC);
01358         SetEditGadgetType(_R(IDC_EDIT1), INT_NUMERIC);
01359         SetEditGadgetType(_R(IDC_EDIT2), REAL_NUMERIC);
01360         SetEditGadgetType(_R(IDC_EDIT3), _R(IDS_BLOBBYXYZ));
01361 
01362         UnitStrList[0] = String(TEXT("Millimetres"));
01363         UnitStrList[1] = String(TEXT("Centimetres"));
01364         UnitStrList[2] = String(TEXT("Metres"));
01365         UnitStrList[3] = String(TEXT("Inches"));
01366         UnitStrList[4] = String(TEXT("Feet"));
01367         UnitStrList[5] = String(TEXT("Yards"));
01368         UnitStrList[6] = String(TEXT("Points"));
01369         UnitStrList[7] = String(TEXT("Picas"));
01370         UnitStrList[8] = String(TEXT("Millipoints"));
01371 
01372         UnitList[0] = MILLIMETRES;
01373         UnitList[1] = CENTIMETRES;
01374         UnitList[2] = METRES;
01375         UnitList[3] = INCHES;
01376         UnitList[4] = FEET;
01377         UnitList[5] = YARDS;
01378         UnitList[6] = COMP_POINTS;
01379         UnitList[7] = PICAS;
01380         UnitList[8] = MILLIPOINTS;
01381 
01382         for (INT32 i=0; i<9; i++)
01383         {
01384             SetStringGadgetValue(_R(IDC_COMBO3), UnitStrList[i],FALSE,i);
01385             SetStringGadgetValue(_R(IDC_COMBO4), UnitStrList[i],FALSE,i);
01386         }
01387 
01388 
01389         InitValues(this);
01390 
01391         return TRUE;
01392     }
01393     else return FALSE;
01394 }

void BlobbyDlg::Do OpDescriptor  )  [virtual]
 

This function should be over-ridden to perform an operation without passing a parameter.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/6/94
Parameters:
OpDesc,: A pointer to the OpDescriptor which invoked the operation [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
Operation::DoWithParam

Reimplemented from Operation.

Definition at line 1398 of file blobby.cpp.

01399 {
01400     Create();
01401     Open();
01402 }

OpState BlobbyDlg::GetState String_256 ,
OpDescriptor
[static]
 

Definition at line 1323 of file blobby.cpp.

01324 {
01325     OpState OpSt;
01326     return(OpSt);
01327 }

BOOL BlobbyDlg::Init void   )  [static]
 

Declares a preference that allows you to clear memory in delete().

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/94
Returns:
TRUE if it worked OK, FALSE if not

Reimplemented from SimpleCCObject.

Definition at line 1331 of file blobby.cpp.

01332 {
01333 
01334 return (RegisterOpDescriptor(
01335                                 0,
01336                                 _R(IDS_BLOBBYDLG),
01337                                 CC_RUNTIME_CLASS(BlobbyDlg),
01338                                 OPTOKEN_BLOBBYDLG,
01339                                 BlobbyDlg::GetState,
01340                                 0,  /* help ID */
01341                                 _R(IDBBL_BLOBBYDLG),
01342                                 0   /* bitmap ID */
01343                                 ));
01344 
01345 }

MsgResult BlobbyDlg::Message Msg Message  )  [virtual]
 

if (IS_OUR_DIALOG_MSG(Message)) { DialogMsg* Msg = (DialogMsg*)Message; Handle Msg here }

Pass message on to base class for rest of handling. return <BaseClass>Message(Message);

This Pure virtual function will ENSURE

Returns:
Errors: -
See also:
MessageHandler

IS_OUR_DIALOG_MSG

Reimplemented from DialogOp.

Definition at line 1168 of file blobby.cpp.

01169 {
01170 
01171     if (IS_OUR_DIALOG_MSG(Message))
01172     {
01173         DialogMsg* Msg = (DialogMsg*)Message;
01174         // Handle ok button
01175         if ((Msg->DlgMsg == DIM_COMMIT) || (Msg->DlgMsg == DIM_CANCEL))
01176         {
01177 
01178 #if 0
01179 BOOL Valid=0;
01180 INT32 Value = (INT32) GetUnitGadgetValue(_R(IDC_UNITVAL),DefaultUnit,-10000000,10000000,0,&Valid);
01181 BitmapEffectAtom::Test(Value);
01182 #endif
01183 
01184             Close(); // Hide the dialog
01185             End();
01186         }
01187         else if (Msg->DlgMsg == DIM_SOFT_COMMIT)
01188         {
01189             InitValues(this);
01190         }
01191 
01192         // wibblewobble
01193         if (((Msg->GadgetID == _R(IDC_BUTTON1)) || (Msg->GadgetID == _R(IDC_BUTTON2)))
01194              && (Msg->DlgMsg == DIM_LFT_BN_CLICKED))
01195         {
01196             BOOL Valid =0;
01197             String_256 Temp = GetStringGadgetValue(_R(IDC_BUTTON1), &Valid);
01198             String_256 Temp2 = GetStringGadgetValue(_R(IDC_BUTTON2), &Valid);
01199             SetStringGadgetValue(_R(IDC_BUTTON1),
01200                                  Temp2);
01201 
01202             SetStringGadgetValue(_R(IDC_BUTTON2),
01203                                  Temp);
01204             SetTitlebarName(&Temp); // Returns a BOOL !!!
01205         }
01206         // Hide and enable
01207         else if ((Msg->GadgetID == _R(IDC_CHECK2)) && (Msg->DlgMsg == DIM_LFT_BN_CLICKED))
01208         {
01209             HideGadgets(this);
01210         }
01211         else if ((Msg->GadgetID == _R(IDC_CHECK1)) && (Msg->DlgMsg == DIM_LFT_BN_CLICKED))
01212         {
01213             EnableGadgets(this);
01214         }
01215         // List sorting
01216         else if ((Msg->GadgetID == _R(IDC_LIST1)) && (Msg->DlgMsg == DIM_SELECTION_CHANGED_COMMIT))
01217         {
01218             // Add the selected item to the sorted list
01219             BOOL Valid =0;
01220             String_256 MoveStr = GetStringGadgetValue(_R(IDC_LIST1), &Valid);
01221             SetStringGadgetValue(_R(IDC_LIST2), MoveStr);
01222             // Delete the selected item
01223             WORD Index;
01224             GetValueIndex(_R(IDC_LIST1), &Index);
01225             DeleteValue(_R(IDC_LIST1), FALSE, Index);
01226         }
01227         else if ((Msg->GadgetID == _R(IDC_LIST2)) && (Msg->DlgMsg == DIM_SELECTION_CHANGED))
01228         {
01229             // Add the selected item to LIST1
01230             BOOL Valid =0;
01231             String_256 MoveStr = GetStringGadgetValue(_R(IDC_LIST2), &Valid);
01232             SetStringGadgetValue(_R(IDC_LIST1), MoveStr);
01233             // Delete the selected item
01234             WORD Index;
01235             GetValueIndex(_R(IDC_LIST2), &Index);
01236             DeleteValue(_R(IDC_LIST2), FALSE, Index);
01237         }
01238         // Scrollbars
01239         else if (Msg->GadgetID == _R(IDC_SCROLLBAR1))
01240         {
01241             BOOL Valid=0;
01242             INT32 Value = (MILLIPOINT)(GetLongGadgetValue(_R(IDC_SCROLLBAR1),0,100,0,&Valid)*72000);
01243             SetUnitGadgetValue(_R(IDC_XVAL), INCHES, Value);
01244         }
01245         else if (Msg->GadgetID == _R(IDC_SCROLLBAR2))
01246         {
01247             BOOL Valid=0;
01248             INT32 Value = (MILLIPOINT)(GetLongGadgetValue(_R(IDC_SCROLLBAR2),0,100,0,&Valid)*72000);
01249             SetUnitGadgetValue(_R(IDC_YVAL), INCHES, Value);
01250         }
01251         // Unit Conversion
01252         else if ((Msg->GadgetID == _R(IDC_COMBO3)) && (Msg->DlgMsg == DIM_SELECTION_CHANGED))
01253         {
01254 //          BOOL Valid=0;
01255             INT32 Index;
01256             GetValueIndex(_R(IDC_COMBO3),&Index);
01257             if ((Index >= 0) && (Index <= 8))
01258                 DefaultUnit = UnitList[Index];
01259         }
01260         else if ((Msg->GadgetID == _R(IDC_COMBO4)) && (Msg->DlgMsg == DIM_SELECTION_CHANGED))
01261         {
01262 //          BOOL Valid=0;
01263             INT32 Index;
01264             GetValueIndex(_R(IDC_COMBO4),&Index);
01265             if ((Index >= 0) && (Index <= 8))
01266                 ConvUnit = UnitList[Index];
01267         }
01268         else if ((Msg->GadgetID == _R(IDC_BUTTON3)) && (Msg->DlgMsg == DIM_LFT_BN_CLICKED))
01269         {
01270             BOOL Valid=0;
01271             MILLIPOINT Value = GetUnitGadgetValue(_R(IDC_UNITVAL),DefaultUnit,-10000000,10000000,0,&Valid);
01272             SetUnitGadgetValue(_R(IDC_CONVVAL), ConvUnit, Value);
01273         }
01274         // Radio buttons
01275         else if ((Msg->GadgetID == _R(IDC_RADIO11)) && (Msg->DlgMsg == DIM_LFT_BN_CLICKED))
01276         {
01277             SetLongGadgetValue(_R(IDC_RADIO23), TRUE);
01278             SetLongGadgetValue(_R(IDC_RADIO21), FALSE);
01279             SetLongGadgetValue(_R(IDC_RADIO22), FALSE);
01280 
01281         }
01282         else if ((Msg->GadgetID == _R(IDC_RADIO12)) && (Msg->DlgMsg == DIM_LFT_BN_CLICKED))
01283         {
01284             SetLongGadgetValue(_R(IDC_RADIO22), TRUE);
01285             SetLongGadgetValue(_R(IDC_RADIO21), FALSE);
01286             SetLongGadgetValue(_R(IDC_RADIO23), FALSE);
01287 
01288         }
01289         else if ((Msg->GadgetID == _R(IDC_RADIO13)) && (Msg->DlgMsg == DIM_LFT_BN_CLICKED))
01290         {
01291             SetLongGadgetValue(_R(IDC_RADIO21), TRUE);
01292             SetLongGadgetValue(_R(IDC_RADIO22), FALSE);
01293             SetLongGadgetValue(_R(IDC_RADIO23), FALSE);
01294         }
01295         else if ((Msg->GadgetID == _R(IDC_RADIO21)) && (Msg->DlgMsg == DIM_LFT_BN_CLICKED))
01296         {
01297             SetLongGadgetValue(_R(IDC_RADIO13), TRUE);
01298             SetLongGadgetValue(_R(IDC_RADIO11), FALSE);
01299             SetLongGadgetValue(_R(IDC_RADIO12), FALSE);
01300 
01301         }
01302         else if ((Msg->GadgetID == _R(IDC_RADIO22)) && (Msg->DlgMsg == DIM_LFT_BN_CLICKED))
01303         {
01304             SetLongGadgetValue(_R(IDC_RADIO12), TRUE);
01305             SetLongGadgetValue(_R(IDC_RADIO11), FALSE);
01306             SetLongGadgetValue(_R(IDC_RADIO13), FALSE);
01307 
01308         }
01309         else if ((Msg->GadgetID == _R(IDC_RADIO23)) && (Msg->DlgMsg == DIM_LFT_BN_CLICKED))
01310         {
01311             SetLongGadgetValue(_R(IDC_RADIO11), TRUE);
01312             SetLongGadgetValue(_R(IDC_RADIO12), FALSE);
01313             SetLongGadgetValue(_R(IDC_RADIO13), FALSE);
01314         }
01315 
01316         return (DLG_EAT_IF_HUNGRY(Msg));
01317     }
01318     return OK;
01319 }


Member Data Documentation

UnitType BlobbyDlg::ConvUnit
 

Definition at line 345 of file blobby.h.

UnitType BlobbyDlg::DefaultUnit
 

Definition at line 344 of file blobby.h.

const UINT32 BlobbyDlg::IDD = _R(IDD_BLOBBYDLG) [static]
 

Definition at line 338 of file blobby.h.

const CDlgMode BlobbyDlg::Mode = MODELESS [static]
 

Definition at line 340 of file blobby.h.

UnitType BlobbyDlg::UnitList[9]
 

Definition at line 343 of file blobby.h.

String_256 BlobbyDlg::UnitStrList[9]
 

Definition at line 342 of file blobby.h.


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