#include <sgallery.h>
Inheritance diagram for SGallerySortDlg:
Public Member Functions | |
SGallerySortDlg () | |
Constructor. | |
~SGallerySortDlg () | |
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 | AddSortKeyName (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 | AddSortKeyName (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_SGSORT) |
static const CDlgMode | Mode = MODELESS |
Protected Member Functions | |
void | ShadeSortFields (void) |
Shades/unshaded the sort fields as appropriate to the button which enables them. | |
void | InitValues (void) |
Initialises the gallery display dialogue, and sets its controls Scope: private. | |
void | SetControls (void) |
(Re)Initialises the sort 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 |
Static Protected Attributes | |
static SGOptsSortInfo | GallerySorts [MaxSGSortKeys] |
Definition at line 791 of file sgallery.h.
|
Constructor.
Definition at line 4128 of file sgallery.cpp. 04129 : DialogOp(SGallerySortDlg::IDD, SGallerySortDlg::Mode) 04130 { 04131 ParentGallery = NULL; 04132 }
|
|
destructor
Definition at line 4147 of file sgallery.cpp. 04148 { 04149 if (ParentGallery != NULL) 04150 ParentGallery->CurrentSortDlg = NULL; 04151 }
|
|
Called (multiple times) by derived gallery classes in response to a call we make (upon opening the dialogue) to ParentGallery->ApplyAction(SGACTION_SETOPTIONS).
The sort mode 0 (Do not sort) is always available. By default, sort mode 1 will be sort-by-name (but only if the base DisplayItem class is called for the comparison, and the parent gallery should call this method with 'sort by name' (_R(IDS_SORTBY_NAME)) first oin order to match up appropriate text to the sort mode.
Definition at line 4293 of file sgallery.cpp. 04294 { 04295 /* 04296 if (!SupportsSorting) 04297 { 04298 SupportsSorting = TRUE; 04299 04300 // We now have evidence to prove that the gallery has supplied its own sort 04301 // modes, so remove 'None' from the first list 04302 DeleteAllValues(GallerySorts[0].ListControlID); 04303 } 04304 */ 04305 for (INT32 i = 0; i < MaxSGSortKeys; i++) 04306 SetStringGadgetValue(GallerySorts[i].ListControlID, *EntryName, TRUE, 0); 04307 }
|
|
Called (multiple times) by derived gallery classes in response to a call we make (upon opening the dialogue) to ParentGallery->ApplyAction(SGACTION_SETOPTIONS).
The sort mode 0 (Do not sort) is always available. By default, sort mode 1 will be sort-by-name (but only if the base DisplayItem class is called for the comparison, and the parent gallery should call this method with 'sort by name' (_R(IDS_SORTBY_NAME)) first oin order to match up appropriate text to the sort mode.
Definition at line 4247 of file sgallery.cpp. 04248 { 04249 /* 04250 if (!SupportsSorting) 04251 { 04252 SupportsSorting = TRUE; 04253 04254 // We now have evidence to prove that the gallery has supplied its own sort 04255 // modes, so remove 'None' from the first list 04256 DeleteAllValues(GallerySorts[0].ListControlID); 04257 } 04258 */ 04259 for (INT32 i = 0; i < MaxSGSortKeys; i++) 04260 SetStringGadgetValue(GallerySorts[i].ListControlID, NameResourceID, TRUE, 0); 04261 }
|
|
Applies the current settings in the dialogue to its parent gallery.
Definition at line 4434 of file sgallery.cpp. 04435 { 04436 if (ParentGallery == NULL) 04437 { 04438 ERROR3("No parent gallery!"); 04439 return; 04440 } 04441 04442 // Copy the new sort mode info into the parent gallery 04443 for (INT32 i = 0; i < MaxSGSortKeys; i++) 04444 { 04445 GallerySorts[i].SortKey.Reversed = GetBoolGadgetSelected(GallerySorts[i].CheckControlID); 04446 ParentGallery->SortKeys[i] = GallerySorts[i].SortKey; 04447 } 04448 04449 ParentGallery->ApplySortNow(GetBoolGadgetSelected(_R(IDC_GALSORT_TOALL))); 04450 }
|
|
Creates a gallery display dialogue box.
Reimplemented from DialogOp. Definition at line 4591 of file sgallery.cpp. 04592 { 04593 ERROR3IF(ParentGallery == NULL, "My ParentGallery is NULL!"); 04594 04595 if (DialogOp::Create()) 04596 { 04597 ParentGallery->CurrentSortDlg = this; 04598 04599 InitValues(); 04600 return(TRUE); 04601 } 04602 04603 return(FALSE); 04604 }
|
|
'Does' a gallery display dialogue op. DO NOT call this method - it must be invoked via DoWithParam
Reimplemented from Operation. Definition at line 4625 of file sgallery.cpp. 04626 { 04627 ERROR3("SGallerySortDlg - You must use DoWithParam (Call InvokeDialog)"); 04628 End(); 04629 }
|
|
'Does' a gallery display dialogue op. Shows the dialogue.
Reimplemented from Operation. Definition at line 4650 of file sgallery.cpp. 04651 { 04652 ERROR3IF(Param == NULL, "Null parameters are illegal"); 04653 04654 ParentGallery = ((GalDlgParam *)Param)->ParentGal; 04655 04656 ERROR3IF(ParentGallery == NULL, "SGallerySortDlg needs a non-NULL parent gallery!"); 04657 04658 if (ParentGallery != NULL && Create()) 04659 Open(); 04660 else 04661 End(); 04662 }
|
|
Get the state of the Colour sort dialogue op.
Definition at line 4540 of file sgallery.cpp. 04541 { 04542 OpState OpSt; 04543 return(OpSt); 04544 }
|
|
Initialises the colour sort dialogue op.
Reimplemented from SimpleCCObject. Definition at line 4563 of file sgallery.cpp. 04564 { 04565 return (RegisterOpDescriptor( 04566 0, 04567 _R(IDS_SGSORTDLG), 04568 CC_RUNTIME_CLASS(SGallerySortDlg), 04569 OPTOKEN_SGSORTDLG, 04570 SGallerySortDlg::GetState, 04571 _R(IDST_GALLERY_MENU), // Status line help 04572 _R(IDBBL_GALLERY_MENU), // Bubble help 04573 0 /* bitmap ID */ 04574 )); 04575 }
|
|
Initialises the gallery display dialogue, and sets its controls Scope: private.
Definition at line 4169 of file sgallery.cpp. 04170 { 04171 if (ParentGallery == NULL) 04172 { 04173 ERROR3("SGallerySortDlg MUST be given a valid parent pointer"); 04174 return; 04175 } 04176 04177 // Fill in the combo boxes etc with the current settings 04178 SetControls(); 04179 }
|
|
Creates a new instance of this dialogue type, connects it to the given gallery, and opens the dialogue on screen.
Definition at line 4199 of file sgallery.cpp. 04200 { 04201 if (Parent->CurrentSortDlg != NULL) // There's one already open! 04202 { 04203 // Bring it to the front of the window stack, then return 04204 Parent->CurrentSortDlg->BringToTop(); 04205 return; 04206 } 04207 04208 GalDlgParam GalOptInfo(Parent); 04209 OpDescriptor *Dlg = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(SGallerySortDlg)); 04210 04211 ERROR3IF(Dlg == NULL, "I can't find the Dialog OpDescriptor"); 04212 04213 if (Dlg != NULL) 04214 Dlg->Invoke(&GalOptInfo); 04215 }
|
|
Standard DialogOp message handler, for the Gallery display dialogue.
Reimplemented from DialogOp. Definition at line 4468 of file sgallery.cpp. 04469 { 04470 if (!(IS_OUR_DIALOG_MSG(Message))) return DialogOp::Message(Message); 04471 04472 DialogMsg* TheMsg = (DialogMsg*)Message; 04473 04474 switch(TheMsg->DlgMsg) 04475 { 04476 case DIM_COMMIT: // OK clicked 04477 Commit(); 04478 // Drop through to CANCEL to close the dlg... 04479 04480 case DIM_CANCEL: // Cancel clicked 04481 Close(); 04482 End(); 04483 return OK; 04484 04485 case DIM_SOFT_COMMIT: // OK "adjust clicked" 04486 Commit(); 04487 break; 04488 04489 case DIM_LFT_BN_CLICKED: 04490 if (TheMsg->GadgetID == _R(IDC_GALSORT_DOSORT)) // Shade/ushade the sort options 04491 ShadeSortFields(); 04492 break; 04493 04494 case DIM_SELECTION_CHANGED: 04495 { 04496 for (INT32 i = 0; i < MaxSGSortKeys; i++) 04497 { 04498 if (TheMsg->GadgetID == GallerySorts[i].ListControlID) 04499 { 04500 WORD Bob; 04501 GetValueIndex(GallerySorts[i].ListControlID, &Bob); 04502 GallerySorts[i].SortKey.SortKey = (INT32) Bob; 04503 04504 // If it's the first sort key, then it doesn't have the 'none' option 04505 if (i == 0) 04506 GallerySorts[i].SortKey.SortKey++; 04507 04508 ShadeSortFields(); // Ensure shading is appropriate 04509 break; 04510 } 04511 } 04512 } 04513 break; 04514 default: 04515 break; 04516 } 04517 04518 return DialogOp::Message(Message); 04519 04520 return OK; 04521 }
|
|
(Re)Initialises the sort dialogue controls (This simply sets the combo boxes etc up from the current settings)
Definition at line 4363 of file sgallery.cpp. 04364 { 04365 if (ParentGallery == NULL) 04366 { 04367 ERROR3("ParentGallery is NULL!"); 04368 return; 04369 } 04370 04371 INT32 i; 04372 04373 // Set up the OK button to respond to Adjust (SOFT_COMMIT) clicks 04374 DualFunctionButton(wxID_OK); 04375 04376 String_32 NoSortName(_R(IDS_SORTBY_NONE)); // Add 'None' to all but the 1st combo box 04377 for (i = 0; i < MaxSGSortKeys; i++) 04378 { 04379 // Copy the last-used sort-mode information from the parent gallery 04380 GallerySorts[i].SortKey = ParentGallery->SortKeys[i]; 04381 04382 // Clear out the sort gadgets, and add 'None' to the head of each list 04383 // GadgetRedraw(GallerySorts[i].ListControlID, FALSE); 04384 DeleteAllValues(GallerySorts[i].ListControlID); 04385 if (i > 0) 04386 SetStringGadgetValue(GallerySorts[i].ListControlID, NoSortName, FALSE, 0); 04387 } 04388 04389 BOOL Result = ParentGallery->ApplyAction(SGACTION_SETSORTMODE); 04390 04391 for (i = 0; i < MaxSGSortKeys; i++) 04392 { 04393 // GadgetRedraw(GallerySorts[i].ListControlID, TRUE); 04394 SetComboListLength(GallerySorts[i].ListControlID); 04395 } 04396 04397 if (Result) 04398 { 04399 // Set the Combo box selections and 'reversed' boxes to the current sort mode 04400 INT32 Selected; 04401 for (i = 0; i < MaxSGSortKeys; i++) 04402 { 04403 // And set the gadgets appropriately 04404 SetBoolGadgetSelected(GallerySorts[i].CheckControlID, GallerySorts[i].SortKey.Reversed); 04405 04406 Selected = GallerySorts[i].SortKey.SortKey; 04407 if (i == 0 && Selected > 0) // The first control has no 'none' option 04408 Selected--; 04409 SetSelectedValueIndex(GallerySorts[i].ListControlID, Selected); 04410 } 04411 } 04412 04413 SetBoolGadgetSelected(_R(IDC_GALSORT_TOALL), TRUE); 04414 SetBoolGadgetSelected(_R(IDC_GALSORT_TOSELONLY), FALSE); 04415 04416 // Shade/unshade the sort fields as appropriate to the setting of the 'sort by:' check 04417 // box, and the currently active sort key(s). 04418 ShadeSortFields(); 04419 }
|
|
Shades/unshaded the sort fields as appropriate to the button which enables them.
Definition at line 4323 of file sgallery.cpp. 04324 { 04325 // If the 'sort' button is on, then shade all the sort fields 04326 BOOL AllowedOn = TRUE; 04327 04328 // If we've made it unshaded and the first item is zero, we need to make it 1, 04329 // as the first field has no 'none' option. 04330 if (GallerySorts[0].SortKey.SortKey == 0) 04331 GallerySorts[0].SortKey.SortKey = 1; 04332 04333 for (INT32 i = 0; i < MaxSGSortKeys; i++) 04334 { 04335 if (i > 0) 04336 AllowedOn = (GallerySorts[i-1].SortKey.SortKey != 0); 04337 04338 EnableGadget(GallerySorts[i].ListControlID, AllowedOn); 04339 EnableGadget(GallerySorts[i].CheckControlID, AllowedOn && GallerySorts[i].SortKey.SortKey != 0); 04340 } 04341 04342 // And finally, the miscellaneous controls 04343 EnableGadget(_R(IDC_GALSORT_GROUP1), TRUE); 04344 EnableGadget(_R(IDC_GALSORT_GROUP2), TRUE); 04345 EnableGadget(_R(IDC_GALSORT_TOALL), TRUE); 04346 EnableGadget(_R(IDC_GALSORT_TOSELONLY), TRUE); 04347 }
|
|
Initial value: { { {0, FALSE}, _R(IDC_GALSORT_SORT1), _R(IDC_GALSORT_REVERSE1) }, { {0, FALSE}, _R(IDC_GALSORT_SORT2), _R(IDC_GALSORT_REVERSE2) } } Definition at line 833 of file sgallery.h. |
|
Definition at line 808 of file sgallery.h. |
|
Definition at line 809 of file sgallery.h. |
|
Definition at line 825 of file sgallery.h. |