00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110 #ifndef INC_DIALOGOP
00111 #define INC_DIALOGOP
00112
00113 #include "ops.h"
00114 #include "dlgtypes.h"
00115 #include "convert.h"
00116
00117 class CGadgetImageList;
00118 class CustomComboBoxControlDataItem;
00119 class DialogManager;
00120 class String_256;
00121 class Node;
00122 class RenderRegion;
00123 class DocRect;
00124 class DialogEventHandler;
00125 struct ReDrawInfoType;
00126 class CBiasGainGadget;
00127 class CProfileBiasGain;
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145 class DialogOp: public Operation
00146 {
00147 friend class DialogEventHandler;
00148 friend class DialogManager;
00149
00150 CC_DECLARE_DYNCREATE( DialogOp )
00151 public:
00152
00153
00154 DialogOp(CDlgResID DialogResID, CDlgMode Mode, CDlgResID SubDialogID = 0,
00155
00156 CCRuntimeClass* Class = CC_RUNTIME_CLASS(DialogOp),
00157 INT32 OpeningPage = -1, CWindowID ParentWnd = NULL);
00158
00159 virtual BOOL IsABar() { return FALSE; }
00160 virtual BOOL IsAGallery() {return FALSE; }
00161 virtual BOOL IsVertical() { return FALSE; }
00162
00163
00164
00165 virtual BOOL Create();
00166
00167
00168 void Open();
00169
00170
00171
00172 void Close();
00173
00174
00175 BOOL IsOpen();
00176
00177
00178 BOOL IsWindowVisible();
00179
00180
00181 BOOL IsCustomComboDropdownVisible(CGadgetID Gadget);
00182
00183
00184
00185 BOOL CloseDropdown (CGadgetID Gadget, BOOL CloseVal);
00186
00187
00188 BOOL HasWindow();
00189
00190
00191 BOOL BringToTop();
00192
00193
00194
00195 BOOL IsGadgetTickable(CGadgetID Gadget);
00196
00197
00198
00199 BOOL ColourPickerAbort(CGadgetID Gadget, WPARAM wParam=0);
00200
00201
00202
00203 ~DialogOp();
00204
00205
00206
00207
00208
00209
00210
00211 RenderRegion* CreateGRenderRegion(DocRect* pRequiredSize, ReDrawInfoType* ExtraInfo,
00212 BOOL UseSelViewColContext = FALSE);
00213 BOOL DestroyGRenderRegion(RenderRegion* pRender);
00214
00215 RenderRegion* CreateOSRenderRegion(DocRect* pRequiredSize, ReDrawInfoType* ExtraInfo,
00216 BOOL UseSelViewColContext = FALSE);
00217 BOOL DestroyOSRenderRegion(RenderRegion* pRender);
00218
00219
00220
00221
00222 void SetComboListLength( CGadgetID Gadget );
00223
00224 BOOL SetUnitGadgetValue( CGadgetID Gadget,
00225 UnitType Unit,
00226 MILLIPOINT value,
00227 BOOL EndOfList = TRUE,
00228 INT32 ListPos = 0);
00229
00230 BOOL SetDimensionUnitGadgetValue(CGadgetID Gadget,
00231 UnitType units,
00232 double value,
00233 Node* pNode,
00234 BOOL IncludeUnitSpecifier = TRUE,
00235 BOOL EndOfList = FALSE,
00236 INT32 ListPos = -1);
00237
00238 BOOL SetLongGadgetValue(CGadgetID Gadget,
00239 INT32 value,
00240 BOOL EndOfList = TRUE,
00241 INT32 ListPos = 0);
00242
00243 BOOL SetDoubleGadgetValue(CGadgetID Gadget,
00244 double value,
00245 BOOL EndOfList = TRUE,
00246 INT32 ListPos = 0);
00247
00248 BOOL SetBoolGadgetSelected(CGadgetID Gadget,
00249 BOOL IsSelected,
00250 INT32 ListPos = 0);
00251
00252 BOOL SetRadioGroupSelected(CGadgetID *GroupGadgets,
00253 CGadgetID SelectedGadget);
00254
00255 BOOL SetStringGadgetValue(CGadgetID Gadget,
00256 UINT32 IDStr,
00257 BOOL EndOfList = TRUE,
00258 INT32 ListPos = 0);
00259
00260 BOOL SetStringGadgetValue(CGadgetID Gadget,
00261 const StringBase& StrVal,
00262 BOOL EndOfList = TRUE,
00263 INT32 ListPos = 0);
00264
00266
00267
00268 BOOL SetCustomComboGadgetValue (CGadgetID Gadget,
00269 CustomComboBoxControlDataItem* TheItem,
00270 BOOL EndOfList = TRUE,
00271 INT32 ListPos = 0);
00272
00273 BOOL SelectCustomComboGadgetValueOnString (CGadgetID Gadget,
00274 StringBase* StrVal);
00275
00277
00278 void BuildResDropList(const CGadgetID DropListID,
00279 const BOOL bIncludeAuto = TRUE,
00280 const BOOL bVerbose = FALSE,
00281 const INT32 Default=0
00282 );
00283 void SetResDropListValue( const CGadgetID DropListID,
00284 const BOOL bIncludeAuto = TRUE,
00285 const INT32 iValue=0
00286 );
00287 INT32 GetResDropListValue(const CGadgetID DropListID,
00288 const BOOL bIncludeAuto = TRUE,
00289 BOOL* bValid = NULL
00290 );
00291
00292 BOOL SetGadgetRange(CGadgetID Gadget, INT32 Min, INT32 Max, INT32 PageInc = 1);
00293
00294 BOOL SetSelectedValueIndex(CGadgetID Gadget, INT32 Index);
00295
00296 BOOL SetSelectedValueRange(CGadgetID Gadget,
00297 WORD StartIndex,
00298 WORD EndIndex,
00299 BOOL Select = TRUE);
00300
00301 BOOL SetDimensionGadgetValue( CGadgetID Gadget,
00302 MILLIPOINT value,
00303 Node* pNode,
00304 BOOL IncludeUnitSpecifier = TRUE,
00305 BOOL EndOfList = FALSE,
00306 INT32 ListPos = 0);
00307
00308 BOOL SetMemoryGadgetValue( CGadgetID Gadget,
00309 UINT32 value,
00310 BOOL EndOfList = TRUE,
00311 INT32 ListPos = 0);
00312
00313 BOOL SetGadgetHelp( CGadgetID Gadget,
00314 UINT32 BubbleID,
00315 UINT32 StatusID,
00316 UINT32 ModuleID = 0);
00317
00318
00319
00320
00321 MILLIPOINT GetUnitGadgetValue(CGadgetID Gadget,
00322 UnitType DefaultType,
00323 MILLIPOINT StartRange,
00324 MILLIPOINT EndRange,
00325 UINT32 IDSInvalidMsg = 0,
00326 BOOL* Valid = NULL);
00327
00328 INT32 GetLongGadgetValue(CGadgetID GadgetID,
00329 INT32 StartRange,
00330 INT32 EndRange,
00331 UINT32 IDSInvalidMsg = 0,
00332 BOOL* Valid = NULL,
00333 Convert::PFNSTRINGTOINT32 pfnParser = Convert::StringToLong);
00334
00335 double GetDoubleGadgetValue(CGadgetID GadgetID,
00336 double StartRange,
00337 double EndRange,
00338 UINT32 IDSInvalidMsg = 0,
00339 BOOL* Valid = NULL,
00340 Convert::PFNSTRINGTODOUBLE pfnParser = Convert::StringToDouble);
00341
00342 BOOL GetDoubleAndUnitGadgetValue(double* pMPValue,
00343 double* pUnitValue,
00344 UnitType* pUnitType,
00345 CGadgetID GadgetID,
00346 Node* pNode);
00347
00348 BOOL GetBoolGadgetSelected(CGadgetID GadgetID,
00349 UINT32 IDSInvalidMsg = 0,
00350 BOOL* Valid = NULL,
00351 INT32 ListPos = -1);
00352
00353 INT32 GetSelectedValueIndex(CGadgetID GadgetID);
00354
00355 CGadgetID GetRadioGroupSelected(CGadgetID *GroupGadgets);
00356
00357 String_256 GetStringGadgetValue(CGadgetID GadgetID, BOOL* Valid = NULL, INT32 ListPos=-1);
00358
00359 BOOL GetGadgetRange(CGadgetID GadgetID, INT32* Min, INT32* Max);
00360
00361 MILLIPOINT GetDimensionGadgetValue( CGadgetID Gadget, Node* pNode, BOOL* Valid = NULL, INT32 ListPos=-1);
00362
00363 UINT32 GetMemoryGadgetValue(CGadgetID Gadget,
00364 UINT32 StartRange,
00365 UINT32 EndRange,
00366 UINT32 IDSInvalidMsg = 0,
00367 BOOL* Valid = NULL);
00368
00369
00370
00371
00372 BOOL DeleteAllValues(CGadgetID GadgetID);
00373 BOOL DeleteValue(CGadgetID GadgetID, BOOL EndOfList = TRUE, INT32 ListPos = 0);
00374 BOOL GetValueCount(CGadgetID GadgetID, INT32* Count);
00375 BOOL GetValueIndex(CGadgetID GadgetID, WORD* Index);
00376 BOOL GetValueIndex(CGadgetID GadgetID, INT32* Index);
00377
00378 INT32 GetSelectedCount(CGadgetID GadgetID);
00379 INT32 GetFirstSelectedItem(CGadgetID GadgetID);
00380 INT32* GetSelectedItems(CGadgetID GadgetID);
00381
00382 BOOL EnableGadget(CGadgetID GadgetID, BOOL Enabled);
00383 BOOL IsGadgetEnabled( CGadgetID Gadget );
00384 BOOL HideGadget(CGadgetID GadgetID, BOOL Hide);
00385 BOOL SetGadgetWritable(CGadgetID Gadget, BOOL enable);
00386 BOOL GadgetRedraw(CGadgetID GadgetID, BOOL Redraw);
00387 void Layout(BOOL CanYield = FALSE);
00388
00389
00390
00391 BOOL SetKeyboardFocus(CGadgetID gadID);
00392 BOOL HighlightText(CGadgetID gadID, INT32 nStart = 0, INT32 nEnd = -1);
00393 BOOL CaptureMouse(CGadgetID gadID);
00394 BOOL ReleaseMouse(CGadgetID gadID);
00395
00396
00397
00398 void PaintGadgetNow(CGadgetID gid);
00399 void InvalidateGadget(CGadgetID Gadget, BOOL EraseBackground=TRUE);
00400
00401
00402 void InvalidateGadget(CGadgetID Gadget,
00403 ReDrawInfoType *ExtraInfo,
00404 DocRect *InvalidRect);
00405
00406
00407
00408 void ScrollKernelRenderedGadget(CGadgetID Gadget,
00409 DocRect *RectToScroll, DocCoord *ScrollBy);
00410
00411
00412 BOOL GetKernelRenderedGadgetInfo(CGadgetID Gadget, ReDrawInfoType *Result);
00413
00414
00415
00416
00417
00418 void SetEditGadgetType(CGadgetID Gadget, EditGadgetType Type);
00419 void SetEditGadgetType(CGadgetID Gadget, UINT32 IDSValidChar);
00420
00421
00422
00423
00424 CTreeItemID SetTreeGadgetItem(CGadgetID Gadget, CTreeItemID hParent, const StringBase& str, CTreeItemID hInsAfter, INT32 iImage, CCObject* pObj = NULL);
00425 CCObject* GetTreeGadgetItemData(CGadgetID Gadget, CTreeItemID hItem);
00426 BOOL SelectTreeGadgetItem(CGadgetID Gadget, CTreeItemID hItem, BOOL bNewState = TRUE);
00427 CTreeItemID GetTreeGadgetRootItem(CGadgetID Gadget);
00428 CTreeItemID GetTreeGadgetFirstSelectedItem(CGadgetID Gadget);
00429 BOOL TreeGadgetExpandItem(CGadgetID Gadget, CTreeItemID hItem);
00430 CTreeItemID GetTreeGadgetNextVisItem(CGadgetID Gadget, CTreeItemID hItem);
00431 CTreeItemID GetTreeGadgetFirstChildItem(CGadgetID Gadget, CTreeItemID hItem);
00432 size_t GetTreeGadgetChildrenCount(CGadgetID Gadget, CTreeItemID hItem, BOOL bRecursive = FALSE);
00433
00434
00435
00436
00437 void DualFunctionButton(CGadgetID ButtonGadget);
00438
00439
00440
00441
00442 void SetGadgetBitmaps(CGadgetID GadgetID, UINT32 Bitmap1, UINT32 Bitmap2);
00443 void SetGadgetBitmaps(CGadgetID GadgetID, const CGadgetImageList& imagelist);
00444 void SetGadgetBitmap(CGadgetID Gadget, ResourceID Bitmap);
00445 ResourceID GetGadgetBitmap(CGadgetID Gadget);
00446 UINT32 GetGadgetImageCount(CGadgetID);
00447
00448
00449
00450 void SetBitmapButtonIndexes(CGadgetID GadgetID, UINT32 UnselectedIndex, UINT32 SelectedIndex);
00451
00452
00453 BOOL MakeListBoxDragable(CGadgetID ListGadget);
00454
00455 virtual MsgResult Message(Msg* Message);
00456
00457 static BOOL IsADialogWindow(CWindowID WndID);
00458
00459
00460 BOOL SetTitlebarName(String_256* Name);
00461
00462
00463
00464
00465
00466 DialogOp();
00467
00468
00469 CWindowID WindowID;
00470
00471 BOOL UpdateStringGadgetValue(CGadgetID Gadget, StringBase* NewString);
00472
00473 OpDescriptor * GetGadgetOpDescriptor(CGadgetID Gadget);
00474
00475 BOOL SendMessageToControl(OpDescriptor * OpDesc, DialogMsg* Msg, BOOL Processed=FALSE);
00476
00477
00478 virtual void DisallowInteractiveProfiles() { m_bInteractiveProfiles = FALSE; }
00479
00480
00481 protected:
00482 void ProfileSelectionChange (DialogMsg* Message, CGadgetID GadgetID);
00483 virtual void ChangeProfile (CProfileBiasGain* Profile, CGadgetID GadgetID);
00484 virtual void ChangeProfileOnIdle (CProfileBiasGain* Profile, CGadgetID GadgetID);
00485
00486
00487 protected:
00488 CDlgResID DlgResID;
00489 CDlgResID SubDlgID;
00490 CDlgMode DlgMode;
00491
00492
00493 CWindowID ParentDlgWnd;
00494
00495 DialogEventHandler* pEvtHandler;
00496
00497 DialogManager* DlgMgr;
00498
00499 CDlgResID ReadWritePage;
00500
00501
00502 INT32 PageToOpen;
00503
00504 public:
00505 CWindowID GetReadWriteWindowID();
00506
00507 public:
00508 BOOL IsModal() { return (DlgMode == MODAL); };
00509 CDlgResID GetCurrentPageID();
00510
00511 public:
00512
00513 UINT32 SetTimer(UINT32 nIDEvent, UINT32 nElapse, void (* lpfnTimer)(void *) = NULL, void * param=NULL, BOOL OneShot=FALSE);
00514 BOOL KillTimer(INT32 nIDEvent);
00515
00516
00517 BOOL GetWindowPosition( wxRect *pRect );
00518 BOOL GetWindowPosition( RECT *pRect );
00519 BOOL GetGadgetPosition( CGadgetID Gadget, wxRect *pRect );
00520 BOOL GetGadgetPosition( CGadgetID Gadget, RECT *pRect );
00521 BOOL SetWindowPosition( const wxRect &Rect);
00522 BOOL SetWindowPosition( const RECT &Rect);
00523 BOOL SetGadgetPosition( CGadgetID Gadget, const wxRect &Rect );
00524 BOOL SetGadgetPosition( CGadgetID Gadget, const RECT &Rect );
00525
00526 INT32 GetScreenDpi();
00527 BOOL GetScreenSize(INT32 * pWidth, INT32 * pHeight);
00528
00529 static DialogOp* FindDialogOp(CDlgResID ResID);
00530
00531 BOOL IsVisible();
00532 virtual void SetVisibility(BOOL Visible);
00533
00534 protected:
00535
00536 virtual BOOL AddControlsToHelper();
00537 virtual void RemoveControlsFromHelper();
00538
00539
00540 BOOL AddDialogControlToHelper(CGadgetID GadgetID);
00541 BOOL AddDialogControlToHelper(CGadgetID GadgetID, CDlgResID PageID);
00542 BOOL RemoveDialogControlFromHelper(CGadgetID GadgetID);
00543 BOOL RemoveDialogControlFromHelper(CGadgetID GadgetID , CDlgResID PageID);
00544
00545 private:
00546 UINT32 MagicWord;
00547 BOOL m_bInteractiveProfiles;
00548
00549 };
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567 class DialogTabOp: public DialogOp
00568 {
00569 CC_DECLARE_DYNCREATE( DialogTabOp )
00570 public:
00571
00572
00573
00574
00575
00576 DialogTabOp(CDlgResID DummyDialogResID,
00577 CDlgMode Mode,
00578 CCRuntimeClass* Class = CC_RUNTIME_CLASS(DialogOp),
00579 INT32 OpeningPage = -1);
00580
00581
00582 virtual BOOL RegisterYourPagesInOrderPlease();
00583
00584
00585
00586 BOOL AddAPage(CDlgResID DialogResID, CGadgetID Gadget=0);
00587
00588
00589
00590 void SetName(String_256* Name);
00591
00592
00593 BOOL TalkToPage(CDlgResID PageID);
00594
00595 String_256* GetName(void);
00596
00597 virtual MsgResult Message(Msg* Message);
00598
00599 virtual void BrushEditDlgOnOK() {}
00600
00601 void SetPropertyPageModified(BOOL Modified);
00602
00603
00604
00605 virtual BOOL LoadFrameFromResources() {return FALSE;}
00606
00607
00608 virtual BOOL HasImages() {return FALSE;}
00609
00610 virtual TabType GetTabType() {return TABTYPE_TABS;}
00611 virtual CGadgetID GetDefaultBookGadget() {return (CGadgetID)0;}
00612
00613
00614
00615 ~DialogTabOp();
00616
00617 DialogTabOp();
00618 private:
00619
00620
00621 String_256 MyName;
00622
00623 };
00624
00625
00626 BOOL UpdateStringGadgetValue(DialogOp* Dialog, UINT32 Gadget, StringBase* NewString);
00627
00628 #endif
00629
00630