4#ifndef __Led_StdDialogs__h__
5#define __Led_StdDialogs__h__ 1
16#include "Stroika/Frameworks/StroikaPreComp.h"
18#include "Stroika/Frameworks/Led/Config.h"
20#if defined(__cplusplus)
21#include "Stroika/Frameworks/Led/GDI.h"
22#include "Stroika/Frameworks/Led/Support.h"
33#ifndef kLedStdDlgCommandBase
34#if qStroika_Platform_Windows
35#define kLedStdDlgCommandBase 0x1000
42#define kLedStdDlgIDBase 0x1000
44#if qStroika_Platform_Windows && defined(__cplusplus)
45#include "Stroika/Frameworks/Led/Platform/Windows.h"
46#include "Stroika/Frameworks/Led/SimpleTextInteractor.h"
47#include "Stroika/Frameworks/Led/SimpleTextStore.h"
50#if defined(__cplusplus)
51namespace Stroika::Frameworks::Led {
54#if defined(__cplusplus)
55 class StdColorPopupHelper {
57 StdColorPopupHelper (
bool allowNone);
58 ~StdColorPopupHelper ();
61 nonvirtual
bool GetSelectedColor (Color* c)
const;
62 nonvirtual
void SetSelectedColor (
const Color& c);
63 nonvirtual
void SetNoSelectedColor ();
66 bool fIsSelectedColor;
67 Color fSelectedColor{Color::kBlack};
70 nonvirtual
size_t MapColorIdx (
const Color& c)
const;
71 nonvirtual Color MapColorIdx (
size_t i)
const;
76#if qStroika_Platform_Windows
78 nonvirtual
void Attach (HWND popup);
84#if qStroika_Platform_Windows
86 nonvirtual
void OnSelChange ();
88#if qStroika_Platform_Windows
90 nonvirtual
void DoMenuAppends ();
91 nonvirtual
void AppendMenuString (
const SDKString& s);
96#if qStroika_Platform_Windows && defined(__cplusplus)
98 namespace LedDialogWidget_Private {
99 using LedDialogWidget_BASE = Platform::Led_Win32_SimpleWndProc_HelperWithSDKMessages<Platform::Led_Win32_Helper<SimpleTextInteractor>>;
102 DISABLE_COMPILER_MSC_WARNING_START (4250)
103 class LedDialogWidget : public LedDialogWidget_Private::LedDialogWidget_BASE {
105 using inherited = LedDialogWidget_Private::LedDialogWidget_BASE;
114 enum DerivedClassSpecifiesTextStore {
115 eDerivedClassSpecifiesTextStore
117 LedDialogWidget (DerivedClassSpecifiesTextStore);
120 virtual ~LedDialogWidget ();
123 virtual void OnBadUserInput ()
override;
126 virtual void OnTypedNormalCharacter (Led_tChar theChar,
bool ,
bool ,
bool ,
127 bool controlPressed,
bool )
override;
130 virtual CommandNumber CharToCommand (Led_tChar theChar)
const;
133 nonvirtual Led_tString GetText ()
const;
134 nonvirtual
void SetText (
const Led_tString& t);
137 SimpleTextStore fTextStore;
138 SingleUndoCommandHandler fCommandHandler;
140 DISABLE_COMPILER_MSC_WARNING_END (4250)
144#if qStroika_Platform_Windows && defined(__cplusplus)
149 class LedComboBoxWidget
150#if qStroika_Platform_Windows
151 :
public Platform::SimpleWin32WndProcHelper
154#if qStroika_Platform_Windows
156 using inherited = Platform::SimpleWin32WndProcHelper;
160 LedComboBoxWidget ();
161 virtual ~LedComboBoxWidget ();
163#if qStroika_Platform_Windows
165 nonvirtual
bool ReplaceWindow (HWND hWnd);
169 nonvirtual Led_tString GetText ()
const;
170 nonvirtual
void SetText (
const Led_tString& t);
173 nonvirtual vector<Led_tString> GetPopupItems ()
const;
174 nonvirtual
void SetPopupItems (
const vector<Led_tString>& pi);
177 vector<Led_tString> fPopupItems;
179#if qStroika_Platform_Windows
181 virtual LRESULT WndProc (UINT message, WPARAM wParam, LPARAM lParam)
override;
184 virtual LRESULT OnCreate_Msg (WPARAM wParam, LPARAM lParam);
185 virtual LRESULT OnSize_Msg (WPARAM wParam, LPARAM lParam);
188#if qStroika_Platform_Windows
190 struct MyButton :
public SimpleWin32WndProcHelper {
191 using inherited = SimpleWin32WndProcHelper;
194 virtual LRESULT WndProc (UINT message, WPARAM wParam, LPARAM lParam)
override;
196 LedComboBoxWidget* fComboBox;
197 Bitmap fDropDownArrow;
199 friend struct MyButton;
202#if qStroika_Platform_Windows
204 struct MyComboListBoxPopup :
public SimpleWin32WndProcHelper {
205 using inherited = SimpleWin32WndProcHelper;
207 MyComboListBoxPopup ();
208 virtual LRESULT WndProc (UINT message, WPARAM wParam, LPARAM lParam)
override;
209 nonvirtual
void UpdatePopupItems ();
210 nonvirtual
void MadeSelection ();
211 nonvirtual
void ComputePreferedHeight (DistanceType* prefHeight,
size_t* nEltsShown)
const;
213 LedComboBoxWidget* fComboBox;
215 friend struct MyComboListBoxPopup;
218#if qStroika_Platform_Windows
220 DISABLE_COMPILER_MSC_WARNING_START (4250)
221 struct MyTextWidget : public LedDialogWidget {
222 using inherited = LedDialogWidget;
226 virtual LRESULT WndProc (UINT message, WPARAM wParam, LPARAM lParam)
override;
228 LedComboBoxWidget* fComboBox;
230 DISABLE_COMPILER_MSC_WARNING_END (4250)
231 friend struct MyTextWidget;
235 nonvirtual
void ShowPopup ();
236 nonvirtual
void HidePopup ();
237 nonvirtual
bool PopupShown ()
const;
238 nonvirtual
void TogglePopupShown ();
241#if qStroika_Platform_Windows
242 MyButton fPopupButton;
243 MyComboListBoxPopup fComboListBoxPopup;
244 MyTextWidget fTextWidget;
245 FontObject* fUseWidgetFont;
250#if defined(__cplusplus)
255 class Led_StdDialogHelper {
257#if qStroika_Platform_Windows
258 Led_StdDialogHelper (HINSTANCE hInstance,
const SDKChar* resID, HWND parentWnd);
262 virtual ~Led_StdDialogHelper ();
265 virtual bool DoModal ();
268 nonvirtual
void ReplaceAllTokens (SDKString* m,
const SDKString& token,
const SDKString& with);
271 virtual void PreDoModalHook ();
274#if qStroika_Platform_Windows
275 HINSTANCE fHINSTANCE;
281 virtual void OnOK ();
282 virtual void OnCancel ();
285 nonvirtual
bool GetWasOK ()
const;
294#if qStroika_Platform_Windows
295 using DialogItemID = int;
298#if qStroika_Platform_Windows
299 nonvirtual
SDKString GetItemText (DialogItemID itemID)
const;
300 nonvirtual
void SetItemText (DialogItemID itemID,
const SDKString& text);
301 nonvirtual
void SelectItemText (DialogItemID itemID,
size_t from = 0,
size_t to =
static_cast<size_t> (-1));
302 nonvirtual
bool GetItemChecked (DialogItemID itemID)
const;
303 nonvirtual
void SetItemChecked (DialogItemID itemID,
bool checked);
304 nonvirtual
bool GetItemEnabled (DialogItemID itemID)
const;
305 nonvirtual
void SetItemEnabled (DialogItemID itemID,
bool enabled);
306 nonvirtual
void SetFocusedItem (DialogItemID itemID);
310#if qStroika_Platform_Windows
311 bool fSetFocusItemCalled;
314#if qStroika_Platform_Windows
316 nonvirtual HWND GetHWND ()
const;
317 nonvirtual
void SetHWND (HWND hWnd);
323#if qStroika_Platform_Windows
325 virtual BOOL OnInitDialog ();
328#if qStroika_Platform_Windows
330 static BOOL CALLBACK StaticDialogProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
333 virtual BOOL DialogProc (UINT message, WPARAM wParam, LPARAM lParam);
338#if qStroika_Platform_Windows
339#define kLedStdDlg_AboutBoxID 0x1001
340#define kLedStdDlg_AboutBox_InfoLedFieldID (kLedStdDlgCommandBase + 1)
341#define kLedStdDlg_AboutBox_LedWebPageFieldID (kLedStdDlgCommandBase + 2)
342#define kLedStdDlg_AboutBox_BigPictureFieldID (kLedStdDlgCommandBase + 3)
343#define kLedStdDlg_AboutBox_VersionFieldID (kLedStdDlgCommandBase + 4)
345#if defined(__cplusplus)
346 class Led_StdDialogHelper_AboutBox :
public Led_StdDialogHelper {
348 using inherited = Led_StdDialogHelper;
351#if qStroika_Platform_Windows
352 Led_StdDialogHelper_AboutBox (HINSTANCE hInstance, HWND parentWnd,
const SDKChar* resID = MAKEINTRESOURCE (kLedStdDlg_AboutBoxID));
356#if qStroika_Platform_Windows
357 virtual BOOL DialogProc (UINT message, WPARAM wParam, LPARAM lParam)
override;
361 virtual void OnClickInInfoField ();
362 virtual void OnClickInLedWebPageField ();
368#if qStroika_Platform_Windows
369#define kLedStdDlg_FindBoxID 0x1002
370#define kLedStdDlg_FindBox_FindText (kLedStdDlgCommandBase + 1)
371#define kLedStdDlg_FindBox_WrapAtEndOfDoc (kLedStdDlgCommandBase + 2)
372#define kLedStdDlg_FindBox_WholeWord (kLedStdDlgCommandBase + 3)
373#define kLedStdDlg_FindBox_IgnoreCase (kLedStdDlgCommandBase + 4)
374#define kLedStdDlg_FindBox_Find (kLedStdDlgCommandBase + 5)
375#define kLedStdDlg_FindBox_Cancel (kLedStdDlgCommandBase + 6)
377#if defined(__cplusplus)
378 class Led_StdDialogHelper_FindDialog :
public Led_StdDialogHelper {
380 using inherited = Led_StdDialogHelper;
383#if qStroika_Platform_Windows
384 Led_StdDialogHelper_FindDialog (HINSTANCE hInstance, HWND parentWnd,
const SDKChar* resID = MAKEINTRESOURCE (kLedStdDlg_FindBoxID));
388#if qStroika_Platform_Windows
389 virtual BOOL DialogProc (UINT message, WPARAM wParam, LPARAM lParam)
override;
393 Led_tString fFindText;
394 vector<Led_tString> fRecentFindTextStrings;
396 bool fWholeWordSearch;
397 bool fCaseSensativeSearch;
401#if qStroika_Platform_Windows
402 LedComboBoxWidget fFindTextWidget;
406 virtual void PreDoModalHook ()
override;
409 virtual void OnFindButton ();
410 virtual void OnDontFindButton ();
415#if qStroika_Platform_Windows
416#define kLedStdDlg_ReplaceBoxID 0x1003
417#define kLedStdDlg_ReplaceBox_FindText (kLedStdDlgCommandBase + 1)
418#define kLedStdDlg_ReplaceBox_ReplaceText (kLedStdDlgCommandBase + 2)
419#define kLedStdDlg_ReplaceBox_WrapAtEndOfDoc (kLedStdDlgCommandBase + 3)
420#define kLedStdDlg_ReplaceBox_WholeWord (kLedStdDlgCommandBase + 4)
421#define kLedStdDlg_ReplaceBox_IgnoreCase (kLedStdDlgCommandBase + 5)
422#define kLedStdDlg_ReplaceBox_Find (kLedStdDlgCommandBase + 6)
423#define kLedStdDlg_ReplaceBox_Cancel (kLedStdDlgCommandBase + 7)
424#define kLedStdDlg_ReplaceBox_Replace (kLedStdDlgCommandBase + 8)
425#define kLedStdDlg_ReplaceBox_ReplaceAll (kLedStdDlgCommandBase + 9)
426#define kLedStdDlg_ReplaceBox_ReplaceAllInSelection (kLedStdDlgCommandBase + 10)
428#if defined(__cplusplus)
429 class Led_StdDialogHelper_ReplaceDialog :
public Led_StdDialogHelper {
431 using inherited = Led_StdDialogHelper;
434#if qStroika_Platform_Windows
435 Led_StdDialogHelper_ReplaceDialog (HINSTANCE hInstance, HWND parentWnd,
const SDKChar* resID = MAKEINTRESOURCE (kLedStdDlg_ReplaceBoxID));
439#if qStroika_Platform_Windows
440 virtual BOOL DialogProc (UINT message, WPARAM wParam, LPARAM lParam)
override;
444 Led_tString fFindText;
445 vector<Led_tString> fRecentFindTextStrings;
446 Led_tString fReplaceText;
448 bool fWholeWordSearch;
449 bool fCaseSensativeSearch;
457 eReplaceAllInSelection
459 ButtonPressed fPressed;
462#if qStroika_Platform_Windows
463 LedComboBoxWidget fFindTextWidget;
464 LedDialogWidget fReplaceTextWidget;
468 virtual void PreDoModalHook ()
override;
471 virtual void OnFindButton ();
472 virtual void OnReplaceButton ();
473 virtual void OnReplaceAllButton ();
474 virtual void OnReplaceAllInSelectionButton ();
475 virtual void OnDontFindButton ();
478 virtual void SaveItems ();
483#if qStroika_Platform_Windows && defined(__cplusplus)
492 class StdColorPickBox {
494#if qStroika_Platform_Windows
495 StdColorPickBox (
const Color& initialColor);
496 StdColorPickBox (HINSTANCE hInstance, HWND parentWnd,
const Color& initialColor);
499#if qStroika_Platform_Windows
504#if qStroika_Platform_Windows
506 virtual bool DoModal ();
509#if qStroika_Platform_Windows
511 static UINT_PTR CALLBACK ColorPickerINITPROC (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
519#if qStroika_Platform_Windows
520#define kLedStdDlg_UpdateWin32FileAssocsDialogID 0x1004
521#define kLedStdDlg_UpdateWin32FileAssocsDialog_Msg (kLedStdDlgCommandBase + 1)
522#define kLedStdDlg_UpdateWin32FileAssocsDialog_KeepCheckingCheckboxMsg (kLedStdDlgCommandBase + 2)
524#if defined(__cplusplus)
529 class Led_StdDialogHelper_UpdateWin32FileAssocsDialog :
public Led_StdDialogHelper {
531 using inherited = Led_StdDialogHelper;
534 Led_StdDialogHelper_UpdateWin32FileAssocsDialog (HINSTANCE hInstance, HWND parentWnd,
535 const SDKChar* resID = MAKEINTRESOURCE (kLedStdDlg_UpdateWin32FileAssocsDialogID));
543 virtual void PreDoModalHook ()
override;
546 virtual void OnOK ()
override;
547 virtual void OnCancel ()
override;
552#if qStroika_Platform_Windows
553#define kLedStdDlg_ParagraphIndentsID 0x1005
554#define kLedStdDlg_ParagraphIndents_LeftMarginFieldID (kLedStdDlgCommandBase + 4)
555#define kLedStdDlg_ParagraphIndents_RightMarginFieldID (kLedStdDlgCommandBase + 6)
556#define kLedStdDlg_ParagraphIndents_FirstIndentFieldID (kLedStdDlgCommandBase + 8)
558#if defined(__cplusplus)
559 class Led_StdDialogHelper_ParagraphIndentsDialog :
public Led_StdDialogHelper {
561 using inherited = Led_StdDialogHelper;
564#if qStroika_Platform_Windows
565 Led_StdDialogHelper_ParagraphIndentsDialog (HINSTANCE hInstance, HWND parentWnd,
566 const SDKChar* resID = MAKEINTRESOURCE (kLedStdDlg_ParagraphIndentsID));
570 virtual void InitValues (TWIPS leftMargin,
bool leftMarginValid, TWIPS rightMargin,
bool rightMarginValid, TWIPS firstIndent,
bool firstIndentValid);
573 virtual void PreDoModalHook ()
override;
576 virtual void OnOK ()
override;
579 bool fLeftMargin_Valid;
580 TWIPS fLeftMargin_Orig;
581 TWIPS fLeftMargin_Result;
582 bool fRightMargin_Valid;
583 TWIPS fRightMargin_Orig;
584 TWIPS fRightMargin_Result;
585 bool fFirstIndent_Valid;
586 TWIPS fFirstIndent_Orig;
587 TWIPS fFirstIndent_Result;
592#if qStroika_Platform_Windows
593#define kLedStdDlg_ParagraphSpacingID 0x1006
594#define kParagraphSpacing_Dialog_SpaceBeforeFieldID (kLedStdDlgCommandBase + 4)
595#define kParagraphSpacing_Dialog_SpaceAfterFieldID (kLedStdDlgCommandBase + 6)
596#define kParagraphSpacing_Dialog_LineSpaceModeFieldID (kLedStdDlgCommandBase + 7)
597#define kParagraphSpacing_Dialog_LineSpaceArgFieldID (kLedStdDlgCommandBase + 8)
599#if defined(__cplusplus)
600 class Led_StdDialogHelper_ParagraphSpacingDialog :
public Led_StdDialogHelper {
602 using inherited = Led_StdDialogHelper;
605#if qStroika_Platform_Windows
606 Led_StdDialogHelper_ParagraphSpacingDialog (HINSTANCE hInstance, HWND parentWnd,
607 const SDKChar* resID = MAKEINTRESOURCE (kLedStdDlg_ParagraphSpacingID));
611 virtual void InitValues (TWIPS spaceBefore,
bool spaceBeforeValid, TWIPS spaceAfter,
bool spaceAfterValid, LineSpacing lineSpacing,
612 bool lineSpacingValid);
615 virtual void PreDoModalHook ()
override;
618 virtual void OnOK ()
override;
621 bool fSpaceBefore_Valid;
622 TWIPS fSpaceBefore_Orig;
623 TWIPS fSpaceBefore_Result;
624 bool fSpaceAfter_Valid;
625 TWIPS fSpaceAfter_Orig;
626 TWIPS fSpaceAfter_Result;
627 bool fLineSpacing_Valid;
628 LineSpacing fLineSpacing_Orig;
629 LineSpacing fLineSpacing_Result;
634#if qStroika_Platform_Windows
635#define kLedStdDlg_OtherFontSizeID 0x1007
636#define kOtherFontSize_Dialog_FontSizeEditFieldID (kLedStdDlgCommandBase + 4)
638#if defined(__cplusplus)
639 class Led_StdDialogHelper_OtherFontSizeDialog :
public Led_StdDialogHelper {
641 using inherited = Led_StdDialogHelper;
644#if qStroika_Platform_Windows
645 Led_StdDialogHelper_OtherFontSizeDialog (HINSTANCE hInstance, HWND parentWnd,
const SDKChar* resID = MAKEINTRESOURCE (kLedStdDlg_OtherFontSizeID));
649 virtual void InitValues (DistanceType origFontSize);
652 virtual void PreDoModalHook ()
override;
655 virtual void OnOK ()
override;
658 DistanceType fFontSize_Orig;
659 DistanceType fFontSize_Result;
664#if qStroika_Platform_Windows
665#define kLedStdDlg_UnknownEmbeddingInfoBoxID 0x1008
666#define kLedStdDlg_UnknownEmbeddingInfoBox_TypeTextMsg (kLedStdDlgCommandBase + 1)
668#if defined(__cplusplus)
669 class Led_StdDialogHelper_UnknownEmbeddingInfoDialog :
public Led_StdDialogHelper {
671 using inherited = Led_StdDialogHelper;
674#if qStroika_Platform_Windows
675 Led_StdDialogHelper_UnknownEmbeddingInfoDialog (HINSTANCE hInstance, HWND parentWnd,
676 const SDKChar* resID = MAKEINTRESOURCE (kLedStdDlg_UnknownEmbeddingInfoBoxID));
683 virtual void PreDoModalHook ()
override;
688#if qStroika_Platform_Windows
689#define kLedStdDlg_URLXEmbeddingInfoBoxID 0x1009
690#define kLedStdDlg_URLXEmbeddingInfoBox_TypeTextMsg (kLedStdDlgCommandBase + 1)
691#define kLedStdDlg_URLXEmbeddingInfoBox_TitleText (kLedStdDlgCommandBase + 4)
692#define kLedStdDlg_URLXEmbeddingInfoBox_URLText (kLedStdDlgCommandBase + 6)
694#if defined(__cplusplus)
695 class Led_StdDialogHelper_URLXEmbeddingInfoDialog :
public Led_StdDialogHelper {
697 using inherited = Led_StdDialogHelper;
700#if qStroika_Platform_Windows
701 Led_StdDialogHelper_URLXEmbeddingInfoDialog (HINSTANCE hInstance, HWND parentWnd,
702 const SDKChar* resID = MAKEINTRESOURCE (kLedStdDlg_URLXEmbeddingInfoBoxID));
711 virtual void PreDoModalHook ()
override;
714 virtual void OnOK ()
override;
718#define kLedStdDlg_AddURLXEmbeddingInfoBoxID 0x100a
719#define kLedStdDlg_AddURLXEmbeddingInfoBox_TitleText (kLedStdDlgCommandBase + 4)
720#define kLedStdDlg_AddURLXEmbeddingInfoBox_URLText (kLedStdDlgCommandBase + 6)
722#if defined(__cplusplus)
723 class Led_StdDialogHelper_AddURLXEmbeddingInfoDialog :
public Led_StdDialogHelper {
725 using inherited = Led_StdDialogHelper;
728#if qStroika_Platform_Windows
729 Led_StdDialogHelper_AddURLXEmbeddingInfoDialog (HINSTANCE hInstance, HWND parentWnd,
730 const SDKChar* resID = MAKEINTRESOURCE (kLedStdDlg_AddURLXEmbeddingInfoBoxID));
738 virtual void PreDoModalHook ()
override;
741 virtual void OnOK ()
override;
746#if qStroika_Platform_Windows
747#define kLedStdDlg_AddNewTableBoxID 0x100b
748#define kLedStdDlg_AddNewTableBox_RowCount (kLedStdDlgCommandBase + 5)
749#define kLedStdDlg_AddNewTableBox_ColCount (kLedStdDlgCommandBase + 7)
751#if defined(__cplusplus)
752 class Led_StdDialogHelper_AddNewTableDialog :
public Led_StdDialogHelper {
754 using inherited = Led_StdDialogHelper;
757#if qStroika_Platform_Windows
758 Led_StdDialogHelper_AddNewTableDialog (HINSTANCE hInstance, HWND parentWnd,
const SDKChar* resID = MAKEINTRESOURCE (kLedStdDlg_AddNewTableBoxID));
766 virtual void PreDoModalHook ()
override;
769 virtual void OnOK ()
override;
774#if qStroika_Platform_Windows
775#define kLedStdDlg_EditTablePropertiesBoxID 0x100c
776#define kLedStdDlg_EditTablePropertiesBox_CellMarginTop (kLedStdDlgCommandBase + 10)
777#define kLedStdDlg_EditTablePropertiesBox_CellMarginLeft (kLedStdDlgCommandBase + 12)
778#define kLedStdDlg_EditTablePropertiesBox_CellMarginBottom (kLedStdDlgCommandBase + 14)
779#define kLedStdDlg_EditTablePropertiesBox_CellMarginRight (kLedStdDlgCommandBase + 16)
781#define kLedStdDlg_EditTablePropertiesBox_DefaultCellSpacing (kLedStdDlgCommandBase + 18)
783#define kLedStdDlg_EditTablePropertiesBox_CellBackgroundColor (kLedStdDlgCommandBase + 23)
785#define kLedStdDlg_EditTablePropertiesBox_ColumnWidth (kLedStdDlgCommandBase + 21)
787#define kLedStdDlg_EditTablePropertiesBox_BorderWidth (kLedStdDlgCommandBase + 6)
788#define kLedStdDlg_EditTablePropertiesBox_BorderColor (kLedStdDlgCommandBase + 7)
790#if defined(__cplusplus)
791 class Led_StdDialogHelper_EditTablePropertiesDialog :
public Led_StdDialogHelper {
793 using inherited = Led_StdDialogHelper;
796#if qStroika_Platform_Windows
797 Led_StdDialogHelper_EditTablePropertiesDialog (HINSTANCE hInstance, HWND parentWnd,
798 const SDKChar* resID = MAKEINTRESOURCE (kLedStdDlg_EditTablePropertiesBoxID));
805 TWIPS fTableBorderWidth;
806 Color fTableBorderColor;
808 TWIPS_Rect fDefaultCellMargins;
811 bool fCellWidth_Common;
814 bool fCellBackgroundColor_Common;
815 Color fCellBackgroundColor;
820 virtual void PreDoModalHook ()
override;
823#if qStroika_Platform_Windows
824 virtual BOOL DialogProc (UINT message, WPARAM wParam, LPARAM lParam)
override;
828 virtual void OnOK ()
override;
831 StdColorPopupHelper fBorderColorPopup;
832 StdColorPopupHelper fCellBackgroundColorPopup;
835 template <
typename T1,
typename T2>
836 static void cvt (T1* o,
const T2& i);
839 template <
typename T1,
typename T2>
840 void Led_StdDialogHelper_EditTablePropertiesDialog::cvt (T1* o,
const T2& i)
842 o->fTableBorderWidth = i.fTableBorderWidth;
843 o->fTableBorderColor = i.fTableBorderColor;
844 o->fDefaultCellMargins = i.fDefaultCellMargins;
845 o->fCellSpacing = i.fCellSpacing;
846 o->fCellWidth_Common = i.fCellWidth_Common;
847 o->fCellWidth = i.fCellWidth;
848 o->fCellBackgroundColor_Common = i.fCellBackgroundColor_Common;
849 o->fCellBackgroundColor = i.fCellBackgroundColor;
851 inline Led_StdDialogHelper_EditTablePropertiesDialog::Info::Info ()
852 : fTableBorderWidth (TWIPS{0})
853 , fTableBorderColor (Color::kWhite)
854 , fDefaultCellMargins ()
855 , fCellSpacing (TWIPS{0})
856 , fCellWidth_Common (false)
857 , fCellWidth (TWIPS{0})
858 , fCellBackgroundColor_Common (false)
859 , fCellBackgroundColor (Color::kWhite)
865#if qStroika_Platform_Windows
866#define kLedStdDlg_SpellCheckBoxID 0x100d
867#define kLedStdDlg_SpellCheckBox_UnknownWordText (kLedStdDlgCommandBase + 1)
868#define kLedStdDlg_SpellCheckBox_ChangeText (kLedStdDlgCommandBase + 2)
869#define kLedStdDlg_SpellCheckBox_SuggestedList (kLedStdDlgCommandBase + 3)
870#define kLedStdDlg_SpellCheckBox_IgnoreOnce (kLedStdDlgCommandBase + 4)
871#define kLedStdDlg_SpellCheckBox_IgnoreAll (kLedStdDlgCommandBase + 5)
872#define kLedStdDlg_SpellCheckBox_ChangeOnce (kLedStdDlgCommandBase + 6)
873#define kLedStdDlg_SpellCheckBox_ChangeAll (kLedStdDlgCommandBase + 7)
874#define kLedStdDlg_SpellCheckBox_AddDictionary (kLedStdDlgCommandBase + 8)
875#define kLedStdDlg_SpellCheckBox_LookupOnWeb (kLedStdDlgCommandBase + 9)
876#define kLedStdDlg_SpellCheckBox_Options (kLedStdDlgCommandBase + 10)
877#define kLedStdDlg_SpellCheckBox_Close (kLedStdDlgCommandBase + 11)
879#if defined(__cplusplus)
880 class Led_StdDialogHelper_SpellCheckDialog :
public Led_StdDialogHelper {
882 using inherited = Led_StdDialogHelper;
885 class SpellCheckDialogCallback;
886 struct MisspellingInfo;
889#if qStroika_Platform_Windows
890 Led_StdDialogHelper_SpellCheckDialog (SpellCheckDialogCallback& callback, HINSTANCE hInstance, HWND parentWnd,
891 const SDKChar* resID = MAKEINTRESOURCE (kLedStdDlg_SpellCheckBoxID));
893 ~Led_StdDialogHelper_SpellCheckDialog ();
896 SpellCheckDialogCallback& fCallback;
899 MisspellingInfo* fCurrentMisspellInfo;
902#if qStroika_Platform_Windows
903 virtual BOOL DialogProc (UINT message, WPARAM wParam, LPARAM lParam)
override;
907#if qStroika_Platform_Windows
908 LedDialogWidget fUndefinedWordWidget;
909 LedDialogWidget fChangeTextWidget;
913 virtual void PreDoModalHook ()
override;
916 virtual void OnIgnoreButton ();
917 virtual void OnIgnoreAllButton ();
918 virtual void OnChangeButton ();
919 virtual void OnChangeAllButton ();
920 virtual void OnAddToDictionaryButton ();
921 virtual void OnLookupOnWebButton ();
922 virtual void OnOptionsDialogButton ();
923 virtual void OnCloseButton ();
924 virtual void OnSuggestionListChangeSelection ();
925 virtual void OnSuggestionListDoubleClick ();
928 virtual void DoFindNextCall ();
931 template <
typename DEL>
932 class CallbackDelegator;
935 struct Led_StdDialogHelper_SpellCheckDialog::MisspellingInfo {
936 Led_tString fUndefinedWord;
937 vector<Led_tString> fSuggestions;
945 class Led_StdDialogHelper_SpellCheckDialog::SpellCheckDialogCallback {
947 using MisspellingInfo = Led_StdDialogHelper_SpellCheckDialog::MisspellingInfo;
950 virtual MisspellingInfo* GetNextMisspelling () = 0;
953 virtual void DoIgnore () = 0;
954 virtual void DoIgnoreAll () = 0;
955 virtual void DoChange (
const Led_tString& changeTo) = 0;
956 virtual void DoChangeAll (
const Led_tString& changeTo) = 0;
957 virtual bool AddToDictionaryEnabled ()
const = 0;
958 virtual void AddToDictionary (
const Led_tString& newWord) = 0;
959 virtual void LookupOnWeb (
const Led_tString& word) = 0;
960 virtual bool OptionsDialogEnabled ()
const = 0;
961 virtual void OptionsDialog () = 0;
964 template <
typename DEL>
965 class Led_StdDialogHelper_SpellCheckDialog::CallbackDelegator :
public Led_StdDialogHelper_SpellCheckDialog::SpellCheckDialogCallback {
967 using inherited = SpellCheckDialogCallback;
970 CallbackDelegator (DEL& del)
977 virtual MisspellingInfo* GetNextMisspelling ()
override
979 typename DEL::MisspellingInfo* delResult = fDelegate.GetNextMisspelling ();
980 if (delResult != NULL) {
981 MisspellingInfo* result =
new MisspellingInfo;
982 result->fUndefinedWord = delResult->fUndefinedWord;
983 result->fSuggestions = delResult->fSuggestions;
991 virtual void DoIgnore ()
override
993 fDelegate.DoIgnore ();
995 virtual void DoIgnoreAll ()
override
997 fDelegate.DoIgnoreAll ();
999 virtual void DoChange (
const Led_tString& changeTo)
override
1001 fDelegate.DoChange (changeTo);
1003 virtual void DoChangeAll (
const Led_tString& changeTo)
override
1005 fDelegate.DoChangeAll (changeTo);
1007 virtual bool AddToDictionaryEnabled ()
const override
1009 return fDelegate.AddToDictionaryEnabled ();
1011 virtual void AddToDictionary (
const Led_tString& newWord)
override
1013 fDelegate.AddToDictionary (newWord);
1015 virtual void LookupOnWeb (
const Led_tString& word)
override
1017 fDelegate.LookupOnWeb (word);
1019 virtual bool OptionsDialogEnabled ()
const override
1021 return fDelegate.OptionsDialogEnabled ();
1023 virtual void OptionsDialog ()
override
1025 fDelegate.OptionsDialog ();
1033#if defined(__cplusplus)
1042#include "StdDialogs.inl"
basic_string< SDKChar > SDKString
conditional_t< qStroika_Foundation_Characters_SDKUseswchar_t, wchar_t, char > SDKChar
Ptr Attach(PlatformNativeHandle sd)