#include <sgallery.h>
Inheritance diagram for SGalleryOptionsDlg:
Public Member Functions | |
SGalleryOptionsDlg () | |
Constructor. | |
~SGalleryOptionsDlg () | |
destructor | |
MsgResult | Message (Msg *Message) |
Standard DialogOp message handler, for the Gallery display dialogue. | |
void | Do (OpDescriptor *) |
'Does' a gallery display dialogue op. DO NOT call this method - it must be invoked via DoWithParam | |
void | DoWithParam (OpDescriptor *, OpParam *Param) |
'Does' a gallery display dialogue op. Shows the dialogue. | |
BOOL | Create () |
Creates a gallery display dialogue box. | |
void | AddDisplayModeName (UINT32 NameResourceID) |
Called (multiple times) by derived gallery classes in response to a call we make (upon opening the dialogue) to ParentGallery->ApplyAction(SGACTION_SETOPTIONS). | |
void | AddDisplayModeName (StringBase *EntryName) |
Called (multiple times) by derived gallery classes in response to a call we make (upon opening the dialogue) to ParentGallery->ApplyAction(SGACTION_SETOPTIONS). | |
Static Public Member Functions | |
static BOOL | Init () |
Initialises the colour sort dialogue op. | |
static OpState | GetState (String_256 *, OpDescriptor *) |
Get the state of the Colour sort dialogue op. | |
static void | InvokeDialog (SuperGallery *Parent) |
Creates a new instance of this dialogue type, connects it to the given gallery, and opens the dialogue on screen. | |
Static Public Attributes | |
static const UINT32 | IDD = _R(IDD_SGDISPLAY) |
static const CDlgMode | Mode = MODELESS |
Protected Member Functions | |
void | InitValues (void) |
Initialises the gallery display dialogue, and sets its controls Scope: private. | |
void | SetControls (void) |
(Re)Initialises the colour manager dialogue controls (This simply sets the combo boxes etc up from the current settings) | |
void | Commit (void) |
Applies the current settings in the dialogue to its parent gallery. | |
Protected Attributes | |
SuperGallery * | ParentGallery |
Definition at line 731 of file sgallery.h.
|
Constructor.
Definition at line 3648 of file sgallery.cpp. 03649 : DialogOp(SGalleryOptionsDlg::IDD, SGalleryOptionsDlg::Mode) 03650 { 03651 ParentGallery = NULL; 03652 }
|
|
destructor
Definition at line 3667 of file sgallery.cpp. 03668 { 03669 if (ParentGallery != NULL) 03670 ParentGallery->CurrentOptionsDlg = NULL; 03671 }
|
|
Called (multiple times) by derived gallery classes in response to a call we make (upon opening the dialogue) to ParentGallery->ApplyAction(SGACTION_SETOPTIONS).
Definition at line 3786 of file sgallery.cpp. 03787 { 03788 SetStringGadgetValue(_R(IDC_SGDISPLAY_DMODE), *EntryName, TRUE, 0); 03789 }
|
|
Called (multiple times) by derived gallery classes in response to a call we make (upon opening the dialogue) to ParentGallery->ApplyAction(SGACTION_SETOPTIONS).
Definition at line 3759 of file sgallery.cpp. 03760 { 03761 SetStringGadgetValue(_R(IDC_SGDISPLAY_DMODE), NameResourceID, TRUE, 0); 03762 }
|
|
Applies the current settings in the dialogue to its parent gallery.
Definition at line 3845 of file sgallery.cpp. 03846 { 03847 if (ParentGallery == NULL) 03848 { 03849 ERROR3("No parent gallery!"); 03850 return; 03851 } 03852 03853 INT32 NewDisplayMode = (INT32) GetSelectedValueIndex(_R(IDC_SGDISPLAY_DMODE)); 03854 INT32 OldDisplayMode = ParentGallery->GetDisplayMode(); 03855 if (NewDisplayMode != OldDisplayMode) 03856 { 03857 SGMiscInfo MiscInfo; 03858 ParentGallery->FillInMiscInfo(&MiscInfo); 03859 03860 DocCoord OldPos(10000, MiscInfo.WindowHeight - 1000); 03861 SGDisplayNode *TopLeftItem = ParentGallery->FindNodeUnderPointer(&OldPos); 03862 03863 INT32 OldScrollPos = ParentGallery->DisplayTree->GetScrollOffset(); 03864 03865 // Set the new display mode 03866 ParentGallery->DisplayMode = NewDisplayMode; 03867 03868 // Get the parent gallery to 'vet' the new display mode number and take any 03869 // appropriate action. 03870 ParentGallery->ApplyAction(SGACTION_DISPLAYMODECHANGED); 03871 03872 // After the gallery has 'vetted' the display mode, if it has really changed, 03873 // we need to redraw the list, and ensure it is not scrolled too far (as the 03874 // list extent has probably just changed dramatically) 03875 if (ParentGallery->GetDisplayMode() != OldDisplayMode) 03876 { 03877 ParentGallery->ForceRedrawOfList(); // Invlaidate the entire listbox 03878 03879 if (ParentGallery->DisplayTree != NULL) 03880 { 03881 // Re-cache the formatting 03882 ParentGallery->GetDisplayExtent(); 03883 03884 INT32 NewPos = OldScrollPos; 03885 if (TopLeftItem != NULL) 03886 { 03887 // If possible, find where the previous top-left item has moved to, 03888 // and set the scroll offset to show that item at the top left 03889 DocRect TheRect; 03890 TopLeftItem->GetFormatRect(&TheRect); 03891 NewPos = ABS(TheRect.hi.y); 03892 } 03893 03894 // And scroll to the current scroll offset (it will automatically clip 03895 // the scroll offset back to a sensible place if necessary) 03896 SGMiscInfo MiscInfo; 03897 ParentGallery->FillInMiscInfo(&MiscInfo); 03898 ParentGallery->DisplayTree->SetScrollOffset(NewPos, &MiscInfo); 03899 } 03900 } 03901 } 03902 }
|
|
Creates a gallery display dialogue box.
Reimplemented from DialogOp. Definition at line 4017 of file sgallery.cpp. 04018 { 04019 ERROR3IF(ParentGallery == NULL, "My ParentGallery is NULL!"); 04020 04021 if (DialogOp::Create()) 04022 { 04023 ParentGallery->CurrentOptionsDlg = this; 04024 04025 InitValues(); 04026 return(TRUE); 04027 } 04028 04029 return(FALSE); 04030 }
|
|
'Does' a gallery display dialogue op. DO NOT call this method - it must be invoked via DoWithParam
Reimplemented from Operation. Definition at line 4051 of file sgallery.cpp. 04052 { 04053 ERROR3("SGalleryOptionsDlg - You must use DoWithParam (Call InvokeDialog)"); 04054 End(); 04055 }
|
|
'Does' a gallery display dialogue op. Shows the dialogue.
Reimplemented from Operation. Definition at line 4076 of file sgallery.cpp. 04077 { 04078 ERROR3IF(Param == NULL, "Null parameters are illegal"); 04079 04080 ParentGallery = ((GalDlgParam *)Param)->ParentGal; 04081 04082 ERROR3IF(ParentGallery == NULL, "SGalleryOptionsDlg needs a non-NULL parent gallery!"); 04083 04084 if (ParentGallery != NULL && Create()) 04085 Open(); 04086 else 04087 End(); 04088 }
|
|
Get the state of the Colour sort dialogue op.
Definition at line 3966 of file sgallery.cpp. 03967 { 03968 OpState OpSt; 03969 return(OpSt); 03970 }
|
|
Initialises the colour sort dialogue op.
Reimplemented from SimpleCCObject. Definition at line 3989 of file sgallery.cpp. 03990 { 03991 return (RegisterOpDescriptor( 03992 0, 03993 _R(IDS_SGOPTIONSDLG), 03994 CC_RUNTIME_CLASS(SGalleryOptionsDlg), 03995 OPTOKEN_SGOPTIONSDLG, 03996 SGalleryOptionsDlg::GetState, 03997 _R(IDST_GALLERY_MENU), // Status line help 03998 _R(IDBBL_GALLERY_MENU), // Bubble help 03999 0 /* bitmap ID */ 04000 )); 04001 }
|
|
Initialises the gallery display dialogue, and sets its controls Scope: private.
Definition at line 3689 of file sgallery.cpp. 03690 { 03691 if (ParentGallery == NULL) 03692 { 03693 ERROR3("SGalleryOptionsDlg MUST be given a valid parent pointer"); 03694 return; 03695 } 03696 03697 // Fill in the combo boxes etc with the current settings 03698 SetControls(); 03699 }
|
|
Creates a new instance of this dialogue type, connects it to the given gallery, and opens the dialogue on screen.
Definition at line 3719 of file sgallery.cpp. 03720 { 03721 if (Parent->CurrentOptionsDlg != NULL) // There's one already open! 03722 { 03723 // Bring it to the front of the window stack, then return 03724 Parent->CurrentOptionsDlg->BringToTop(); 03725 return; 03726 } 03727 03728 GalDlgParam GalOptInfo(Parent); 03729 OpDescriptor *Dlg = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(SGalleryOptionsDlg)); 03730 03731 ERROR3IF(Dlg == NULL, "I can't find the Dialog OpDescriptor"); 03732 03733 if (Dlg != NULL) 03734 Dlg->Invoke(&GalOptInfo); 03735 }
|
|
Standard DialogOp message handler, for the Gallery display dialogue.
Reimplemented from DialogOp. Definition at line 3920 of file sgallery.cpp. 03921 { 03922 if (!(IS_OUR_DIALOG_MSG(Message))) return DialogOp::Message(Message); 03923 03924 DialogMsg* TheMsg = (DialogMsg*)Message; 03925 03926 switch(TheMsg->DlgMsg) 03927 { 03928 case DIM_COMMIT: // OK clicked 03929 Commit(); 03930 // Drop through to CANCEL to close the dlg... 03931 03932 case DIM_CANCEL: // Cancel clicked 03933 Close(); 03934 End(); 03935 return OK; 03936 break; 03937 03938 case DIM_SOFT_COMMIT: // OK "adjust clicked" 03939 Commit(); 03940 break; 03941 03942 default: 03943 break; 03944 } 03945 03946 return DialogOp::Message(Message); 03947 }
|
|
(Re)Initialises the colour manager dialogue controls (This simply sets the combo boxes etc up from the current settings)
Definition at line 3805 of file sgallery.cpp. 03806 { 03807 if (ParentGallery == NULL) 03808 { 03809 ERROR3("ParentGallery is NULL!"); 03810 return; 03811 } 03812 03813 // Set up the OK button to respond to Adjust (SOFT_COMMIT) clicks 03814 DualFunctionButton(wxID_OK); 03815 03816 // Set values in our combo boxes - the gallery will call us back to do this 03817 DeleteAllValues(_R(IDC_SGDISPLAY_DMODE)); 03818 GadgetRedraw(_R(IDC_SGDISPLAY_DMODE), FALSE); 03819 03820 BOOL Result = ParentGallery->ApplyAction(SGACTION_SETOPTIONS); 03821 03822 EnableGadget(_R(IDC_SGDISPLAY_DMODE), Result); 03823 GadgetRedraw(_R(IDC_SGDISPLAY_DMODE), TRUE); 03824 03825 if (Result) 03826 { 03827 SetSelectedValueIndex(_R(IDC_SGDISPLAY_DMODE), (INT32) ParentGallery->GetDisplayMode()); 03828 SetComboListLength(_R(IDC_SGDISPLAY_DMODE)); 03829 } 03830 }
|
|
Definition at line 748 of file sgallery.h. |
|
Definition at line 749 of file sgallery.h. |
|
Definition at line 761 of file sgallery.h. |