mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 21:20:46 +02:00
MaskEdit property editor: fix issue #40696.
- load and save which sample file was loaded - add ability to unload a sample file
This commit is contained in:
parent
9776c68b28
commit
c819e0ed2a
@ -328,6 +328,10 @@
|
|||||||
<AddToUsesPkgSection Value="False"/>
|
<AddToUsesPkgSection Value="False"/>
|
||||||
<UnitName Value="PagesPropEditDlg"/>
|
<UnitName Value="PagesPropEditDlg"/>
|
||||||
</Item>
|
</Item>
|
||||||
|
<Item>
|
||||||
|
<Filename Value="propeditconfig.pp"/>
|
||||||
|
<UnitName Value="PropEditConfig"/>
|
||||||
|
</Item>
|
||||||
</Files>
|
</Files>
|
||||||
<LazDoc Paths="docs"/>
|
<LazDoc Paths="docs"/>
|
||||||
<i18n>
|
<i18n>
|
||||||
|
@ -21,7 +21,7 @@ uses
|
|||||||
PropEdits, PropEditUtils, SrcEditorIntf, StatusBarPropEdit,
|
PropEdits, PropEditUtils, SrcEditorIntf, StatusBarPropEdit,
|
||||||
StringsPropEditDlg, TextTools, ToolBarIntf, TreeViewPropEdit, UnitResources,
|
StringsPropEditDlg, TextTools, ToolBarIntf, TreeViewPropEdit, UnitResources,
|
||||||
bufdatasetdsgn, selectdatasetdlg, SelEdits, IdeIntfStrConsts,
|
bufdatasetdsgn, selectdatasetdlg, SelEdits, IdeIntfStrConsts,
|
||||||
LazarusPackageIntf;
|
PropEditConfig, LazarusPackageIntf;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
@ -1330,6 +1330,14 @@ msgctxt "objinspstrconsts.oisunknown"
|
|||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "Desconegut"
|
msgstr "Desconegut"
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunload
|
||||||
|
msgid "Unload"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunloadhint
|
||||||
|
msgid "Unloads the current sample file"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: objinspstrconsts.oisunselectall
|
#: objinspstrconsts.oisunselectall
|
||||||
msgid "&Unselect all"
|
msgid "&Unselect all"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -1294,6 +1294,14 @@ msgctxt "objinspstrconsts.oisunknown"
|
|||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "Neznámý"
|
msgstr "Neznámý"
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunload
|
||||||
|
msgid "Unload"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunloadhint
|
||||||
|
msgid "Unloads the current sample file"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: objinspstrconsts.oisunselectall
|
#: objinspstrconsts.oisunselectall
|
||||||
msgid "&Unselect all"
|
msgid "&Unselect all"
|
||||||
msgstr "&Nevybrat nic"
|
msgstr "&Nevybrat nic"
|
||||||
|
@ -1292,6 +1292,14 @@ msgctxt "objinspstrconsts.oisunknown"
|
|||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "Unbekannt"
|
msgstr "Unbekannt"
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunload
|
||||||
|
msgid "Unload"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunloadhint
|
||||||
|
msgid "Unloads the current sample file"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: objinspstrconsts.oisunselectall
|
#: objinspstrconsts.oisunselectall
|
||||||
msgid "&Unselect all"
|
msgid "&Unselect all"
|
||||||
msgstr "Alles abwählen"
|
msgstr "Alles abwählen"
|
||||||
|
@ -1295,6 +1295,14 @@ msgctxt "objinspstrconsts.oisunknown"
|
|||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "Desconocido"
|
msgstr "Desconocido"
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunload
|
||||||
|
msgid "Unload"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunloadhint
|
||||||
|
msgid "Unloads the current sample file"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: objinspstrconsts.oisunselectall
|
#: objinspstrconsts.oisunselectall
|
||||||
msgid "&Unselect all"
|
msgid "&Unselect all"
|
||||||
msgstr "Deseleccionar todo"
|
msgstr "Deseleccionar todo"
|
||||||
|
@ -1286,6 +1286,14 @@ msgctxt "objinspstrconsts.oisunknown"
|
|||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "Tuntematon"
|
msgstr "Tuntematon"
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunload
|
||||||
|
msgid "Unload"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunloadhint
|
||||||
|
msgid "Unloads the current sample file"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: objinspstrconsts.oisunselectall
|
#: objinspstrconsts.oisunselectall
|
||||||
msgid "&Unselect all"
|
msgid "&Unselect all"
|
||||||
msgstr "&Poista valinta kaikista"
|
msgstr "&Poista valinta kaikista"
|
||||||
|
@ -1290,6 +1290,14 @@ msgctxt "objinspstrconsts.oisunknown"
|
|||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "Inconnu"
|
msgstr "Inconnu"
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunload
|
||||||
|
msgid "Unload"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunloadhint
|
||||||
|
msgid "Unloads the current sample file"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: objinspstrconsts.oisunselectall
|
#: objinspstrconsts.oisunselectall
|
||||||
msgid "&Unselect all"
|
msgid "&Unselect all"
|
||||||
msgstr "&Tout désélectionner"
|
msgstr "&Tout désélectionner"
|
||||||
|
@ -1336,6 +1336,14 @@ msgctxt "objinspstrconsts.oisunknown"
|
|||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "לא ידוע "
|
msgstr "לא ידוע "
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunload
|
||||||
|
msgid "Unload"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunloadhint
|
||||||
|
msgid "Unloads the current sample file"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: objinspstrconsts.oisunselectall
|
#: objinspstrconsts.oisunselectall
|
||||||
msgid "&Unselect all"
|
msgid "&Unselect all"
|
||||||
msgstr "בטל את כל הבחירות"
|
msgstr "בטל את כל הבחירות"
|
||||||
|
@ -1293,6 +1293,14 @@ msgctxt "objinspstrconsts.oisunknown"
|
|||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "Ismeretlen"
|
msgstr "Ismeretlen"
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunload
|
||||||
|
msgid "Unload"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunloadhint
|
||||||
|
msgid "Unloads the current sample file"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: objinspstrconsts.oisunselectall
|
#: objinspstrconsts.oisunselectall
|
||||||
msgid "&Unselect all"
|
msgid "&Unselect all"
|
||||||
msgstr "Kijelölések megszüntetése"
|
msgstr "Kijelölések megszüntetése"
|
||||||
|
@ -1334,6 +1334,14 @@ msgctxt "objinspstrconsts.oisunknown"
|
|||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "Tidak dikenal"
|
msgstr "Tidak dikenal"
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunload
|
||||||
|
msgid "Unload"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunloadhint
|
||||||
|
msgid "Unloads the current sample file"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: objinspstrconsts.oisunselectall
|
#: objinspstrconsts.oisunselectall
|
||||||
msgid "&Unselect all"
|
msgid "&Unselect all"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -1296,6 +1296,14 @@ msgctxt "objinspstrconsts.oisunknown"
|
|||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "Sconosciuto"
|
msgstr "Sconosciuto"
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunload
|
||||||
|
msgid "Unload"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunloadhint
|
||||||
|
msgid "Unloads the current sample file"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: objinspstrconsts.oisunselectall
|
#: objinspstrconsts.oisunselectall
|
||||||
msgid "&Unselect all"
|
msgid "&Unselect all"
|
||||||
msgstr "&Deseleziona tutto"
|
msgstr "&Deseleziona tutto"
|
||||||
|
@ -1301,6 +1301,14 @@ msgctxt "objinspstrconsts.oisunknown"
|
|||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "不明"
|
msgstr "不明"
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunload
|
||||||
|
msgid "Unload"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunloadhint
|
||||||
|
msgid "Unloads the current sample file"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: objinspstrconsts.oisunselectall
|
#: objinspstrconsts.oisunselectall
|
||||||
msgid "&Unselect all"
|
msgid "&Unselect all"
|
||||||
msgstr "すべての選択を解除(&U)"
|
msgstr "すべての選択を解除(&U)"
|
||||||
|
@ -1294,6 +1294,14 @@ msgctxt "objinspstrconsts.oisunknown"
|
|||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "Nežinoma"
|
msgstr "Nežinoma"
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunload
|
||||||
|
msgid "Unload"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunloadhint
|
||||||
|
msgid "Unloads the current sample file"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: objinspstrconsts.oisunselectall
|
#: objinspstrconsts.oisunselectall
|
||||||
msgid "&Unselect all"
|
msgid "&Unselect all"
|
||||||
msgstr "&Naikinti visą žymėjimą"
|
msgstr "&Naikinti visą žymėjimą"
|
||||||
|
@ -1321,6 +1321,14 @@ msgctxt "objinspstrconsts.oisunknown"
|
|||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "Onbekend"
|
msgstr "Onbekend"
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunload
|
||||||
|
msgid "Unload"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunloadhint
|
||||||
|
msgid "Unloads the current sample file"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: objinspstrconsts.oisunselectall
|
#: objinspstrconsts.oisunselectall
|
||||||
msgid "&Unselect all"
|
msgid "&Unselect all"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -1288,6 +1288,14 @@ msgctxt "objinspstrconsts.oisunknown"
|
|||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "Nieznany"
|
msgstr "Nieznany"
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunload
|
||||||
|
msgid "Unload"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunloadhint
|
||||||
|
msgid "Unloads the current sample file"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: objinspstrconsts.oisunselectall
|
#: objinspstrconsts.oisunselectall
|
||||||
msgid "&Unselect all"
|
msgid "&Unselect all"
|
||||||
msgstr "Odznacz wszystko"
|
msgstr "Odznacz wszystko"
|
||||||
|
@ -1280,6 +1280,14 @@ msgctxt "objinspstrconsts.oisunknown"
|
|||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunload
|
||||||
|
msgid "Unload"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunloadhint
|
||||||
|
msgid "Unloads the current sample file"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: objinspstrconsts.oisunselectall
|
#: objinspstrconsts.oisunselectall
|
||||||
msgid "&Unselect all"
|
msgid "&Unselect all"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -1289,6 +1289,14 @@ msgctxt "objinspstrconsts.oisunknown"
|
|||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "Desconhecido"
|
msgstr "Desconhecido"
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunload
|
||||||
|
msgid "Unload"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunloadhint
|
||||||
|
msgid "Unloads the current sample file"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: objinspstrconsts.oisunselectall
|
#: objinspstrconsts.oisunselectall
|
||||||
msgid "&Unselect all"
|
msgid "&Unselect all"
|
||||||
msgstr "&Desmarcar tudo"
|
msgstr "&Desmarcar tudo"
|
||||||
|
@ -1289,6 +1289,14 @@ msgctxt "objinspstrconsts.oisunknown"
|
|||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "Неизвестный"
|
msgstr "Неизвестный"
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunload
|
||||||
|
msgid "Unload"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunloadhint
|
||||||
|
msgid "Unloads the current sample file"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: objinspstrconsts.oisunselectall
|
#: objinspstrconsts.oisunselectall
|
||||||
msgid "&Unselect all"
|
msgid "&Unselect all"
|
||||||
msgstr "&Снять выделение"
|
msgstr "&Снять выделение"
|
||||||
|
@ -1303,6 +1303,14 @@ msgctxt "objinspstrconsts.oisunknown"
|
|||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "Neznámy"
|
msgstr "Neznámy"
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunload
|
||||||
|
msgid "Unload"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunloadhint
|
||||||
|
msgid "Unloads the current sample file"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: objinspstrconsts.oisunselectall
|
#: objinspstrconsts.oisunselectall
|
||||||
msgid "&Unselect all"
|
msgid "&Unselect all"
|
||||||
msgstr "&Odznačiť všetko"
|
msgstr "&Odznačiť všetko"
|
||||||
|
@ -1289,6 +1289,14 @@ msgctxt "objinspstrconsts.oisunknown"
|
|||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "Bilinmeyen"
|
msgstr "Bilinmeyen"
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunload
|
||||||
|
msgid "Unload"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunloadhint
|
||||||
|
msgid "Unloads the current sample file"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: objinspstrconsts.oisunselectall
|
#: objinspstrconsts.oisunselectall
|
||||||
msgid "&Unselect all"
|
msgid "&Unselect all"
|
||||||
msgstr "&Tüm seçimleri kaldır"
|
msgstr "&Tüm seçimleri kaldır"
|
||||||
|
@ -1292,6 +1292,14 @@ msgctxt "objinspstrconsts.oisunknown"
|
|||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "Невідомий"
|
msgstr "Невідомий"
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunload
|
||||||
|
msgid "Unload"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunloadhint
|
||||||
|
msgid "Unloads the current sample file"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: objinspstrconsts.oisunselectall
|
#: objinspstrconsts.oisunselectall
|
||||||
msgid "&Unselect all"
|
msgid "&Unselect all"
|
||||||
msgstr "&Зняти вибір з всіх"
|
msgstr "&Зняти вибір з всіх"
|
||||||
|
@ -1290,6 +1290,14 @@ msgctxt "objinspstrconsts.oisunknown"
|
|||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "未知"
|
msgstr "未知"
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunload
|
||||||
|
msgid "Unload"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: objinspstrconsts.oisunloadhint
|
||||||
|
msgid "Unloads the current sample file"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: objinspstrconsts.oisunselectall
|
#: objinspstrconsts.oisunselectall
|
||||||
msgid "&Unselect all"
|
msgid "&Unselect all"
|
||||||
msgstr "不选择所有(&U)"
|
msgstr "不选择所有(&U)"
|
||||||
|
@ -84,7 +84,7 @@ object MaskEditorForm: TMaskEditorForm
|
|||||||
Constraints.MinWidth = 300
|
Constraints.MinWidth = 300
|
||||||
ItemHeight = 0
|
ItemHeight = 0
|
||||||
Style = lbOwnerDrawFixed
|
Style = lbOwnerDrawFixed
|
||||||
TabOrder = 6
|
TabOrder = 7
|
||||||
OnClick = SampleMasksListBoxClick
|
OnClick = SampleMasksListBoxClick
|
||||||
OnDrawItem = SampleMasksListBoxDrawItem
|
OnDrawItem = SampleMasksListBoxDrawItem
|
||||||
end
|
end
|
||||||
@ -199,7 +199,7 @@ object MaskEditorForm: TMaskEditorForm
|
|||||||
CloseButton.DefaultCaption = True
|
CloseButton.DefaultCaption = True
|
||||||
CancelButton.Name = 'CancelButton'
|
CancelButton.Name = 'CancelButton'
|
||||||
CancelButton.DefaultCaption = True
|
CancelButton.DefaultCaption = True
|
||||||
TabOrder = 7
|
TabOrder = 8
|
||||||
ShowButtons = [pbOK, pbCancel, pbHelp]
|
ShowButtons = [pbOK, pbCancel, pbHelp]
|
||||||
end
|
end
|
||||||
object EnableSetsCheckBox: TCheckBox
|
object EnableSetsCheckBox: TCheckBox
|
||||||
@ -219,6 +219,21 @@ object MaskEditorForm: TMaskEditorForm
|
|||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
OnClick = EnableSetsCheckBoxClick
|
OnClick = EnableSetsCheckBoxClick
|
||||||
end
|
end
|
||||||
|
object UnloadSampleMasksButton: TButton
|
||||||
|
AnchorSideLeft.Control = LoadSampleMasksButton
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
|
AnchorSideTop.Control = LoadSampleMasksButton
|
||||||
|
Left = 87
|
||||||
|
Height = 25
|
||||||
|
Top = 222
|
||||||
|
Width = 75
|
||||||
|
BorderSpacing.Left = 6
|
||||||
|
Caption = 'Unload'
|
||||||
|
ParentShowHint = False
|
||||||
|
ShowHint = True
|
||||||
|
TabOrder = 6
|
||||||
|
OnClick = UnloadSampleMasksButtonClick
|
||||||
|
end
|
||||||
object OpenDialog1: TOpenDialog
|
object OpenDialog1: TOpenDialog
|
||||||
Title = 'Open mask file (*.dem)'
|
Title = 'Open mask file (*.dem)'
|
||||||
DefaultExt = '.dem'
|
DefaultExt = '.dem'
|
||||||
|
@ -24,7 +24,7 @@ uses
|
|||||||
// LazUtils
|
// LazUtils
|
||||||
LazUTF8, LazFileUtils,
|
LazUTF8, LazFileUtils,
|
||||||
// IdeIntf
|
// IdeIntf
|
||||||
LazIDEIntf, PropEdits, ComponentEditors, ObjInspStrConsts, IDEWindowIntf;
|
LazIDEIntf, PropEdits, ComponentEditors, ObjInspStrConsts, IDEWindowIntf, PropEditConfig;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -41,6 +41,7 @@ type
|
|||||||
ButtonPanel1: TButtonPanel;
|
ButtonPanel1: TButtonPanel;
|
||||||
EnableSetsCheckBox: TCheckBox;
|
EnableSetsCheckBox: TCheckBox;
|
||||||
LoadSampleMasksButton: TButton;
|
LoadSampleMasksButton: TButton;
|
||||||
|
UnloadSampleMasksButton: TButton;
|
||||||
SaveLiteralCheckBox: TCheckBox;
|
SaveLiteralCheckBox: TCheckBox;
|
||||||
InputMaskEdit: TEdit;
|
InputMaskEdit: TEdit;
|
||||||
CharactersForBlanksEdit: TEdit;
|
CharactersForBlanksEdit: TEdit;
|
||||||
@ -55,6 +56,7 @@ type
|
|||||||
procedure EnableSetsCheckBoxClick(Sender: TObject);
|
procedure EnableSetsCheckBoxClick(Sender: TObject);
|
||||||
procedure FormClose(Sender: TObject; var {%H-}CloseAction: TCloseAction);
|
procedure FormClose(Sender: TObject; var {%H-}CloseAction: TCloseAction);
|
||||||
procedure LoadSampleMasksButtonClick(Sender: TObject);
|
procedure LoadSampleMasksButtonClick(Sender: TObject);
|
||||||
|
procedure UnloadSampleMasksButtonClick(Sender: TObject);
|
||||||
procedure SampleMasksListBoxDrawItem(Control: TWinControl; Index: Integer;
|
procedure SampleMasksListBoxDrawItem(Control: TWinControl; Index: Integer;
|
||||||
ARect: TRect; {%H-}State: TOwnerDrawState);
|
ARect: TRect; {%H-}State: TOwnerDrawState);
|
||||||
procedure SaveLiteralCheckBoxClick(Sender: TObject);
|
procedure SaveLiteralCheckBoxClick(Sender: TObject);
|
||||||
@ -65,13 +67,13 @@ type
|
|||||||
private
|
private
|
||||||
FEnableSets: Boolean;
|
FEnableSets: Boolean;
|
||||||
ParsedSamples: TParsedSamples;
|
ParsedSamples: TParsedSamples;
|
||||||
|
FSampleEditMaskFilename: String;
|
||||||
function ConstructEditmask: String;
|
function ConstructEditmask: String;
|
||||||
function GetEditMask: string;
|
function GetEditMask: string;
|
||||||
function MaskDoFormatText(const EditMask: string; const Value: string; EnableSets: Boolean): String;
|
function MaskDoFormatText(const EditMask: string; const Value: string; EnableSets: Boolean): String;
|
||||||
function ParseMaskLineDelphi(Line: String; EnableSets: Boolean; out aCaption, aExample, aFormattedExample, aMask: String): Boolean;
|
function ParseMaskLineDelphi(Line: String; EnableSets: Boolean; out aCaption, aExample, aFormattedExample, aMask: String): Boolean;
|
||||||
function ParseMaskLineLazarus(Line: String; EnableSets: Boolean; out aCaption, aExample, aFormattedExample, aMask: String): Boolean;
|
function ParseMaskLineLazarus(Line: String; EnableSets: Boolean; out aCaption, aExample, aFormattedExample, aMask: String): Boolean;
|
||||||
procedure LoadAndCleanSampleFile(Fn: String; EnableSets: Boolean; List: TStrings; out AParsedSamples: TParsedSamples); //out list of record?
|
procedure LoadAndCleanSampleFile(Fn: String; EnableSets: Boolean; List: TStrings; out AParsedSamples: TParsedSamples); //out list of record?
|
||||||
procedure LoadDEMFile(AFileName: string);
|
|
||||||
procedure ReConstructEditmask;
|
procedure ReConstructEditmask;
|
||||||
procedure SetEditMask(AValue: string);
|
procedure SetEditMask(AValue: string);
|
||||||
procedure SetEnableSets(AValue: Boolean);
|
procedure SetEnableSets(AValue: Boolean);
|
||||||
@ -102,6 +104,8 @@ type
|
|||||||
function MaskEdit: TCustomMaskEditAccess; virtual;
|
function MaskEdit: TCustomMaskEditAccess; virtual;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
{$R *.lfm}
|
{$R *.lfm}
|
||||||
@ -110,11 +114,11 @@ implementation
|
|||||||
{ TMaskEditorForm }
|
{ TMaskEditorForm }
|
||||||
|
|
||||||
procedure TMaskEditorForm.MaskEditorFormCreate(Sender: TObject);
|
procedure TMaskEditorForm.MaskEditorFormCreate(Sender: TObject);
|
||||||
var
|
|
||||||
aDemFile: string;
|
|
||||||
begin
|
begin
|
||||||
Caption := oisInputMaskEditor;
|
Caption := oisInputMaskEditor;
|
||||||
LoadSampleMasksButton.Caption := oisMasks;
|
LoadSampleMasksButton.Caption := oisMasks;
|
||||||
|
UnloadSampleMasksButton.Caption := oisUnload;
|
||||||
|
UnloadSampleMasksButton.Hint := oisUnloadHint; // alternatively have a longer caption?
|
||||||
SaveLiteralCheckBox.Caption := oisSaveLiteralCharacters;
|
SaveLiteralCheckBox.Caption := oisSaveLiteralCharacters;
|
||||||
InputMaskLabel.Caption := oisInputMask;
|
InputMaskLabel.Caption := oisInputMask;
|
||||||
SampleMasksLabel.Caption := oisSampleMasks;
|
SampleMasksLabel.Caption := oisSampleMasks;
|
||||||
@ -125,21 +129,30 @@ begin
|
|||||||
OpenDialog1.Filter := oisMaskSampleFilter;
|
OpenDialog1.Filter := oisMaskSampleFilter;
|
||||||
OpenDialog1.Title := oisSelectInputMaskSample;
|
OpenDialog1.Title := oisSelectInputMaskSample;
|
||||||
|
|
||||||
if LazarusIDE<>nil then
|
if not Assigned(PropEditConfigs) then
|
||||||
aDemFile:=LazarusIDE.GetPrimaryConfigPath
|
PropEditConfigs := TPropEditConfigs.Create;
|
||||||
else
|
PropEditConfigs.Load;
|
||||||
aDemFile:=ExtractFileDir(ParamStrUTF8(0));
|
FSampleEditMaskFilename := PropEditConfigs.SampleEditMaskFilename;
|
||||||
aDemFile:=CleanAndExpandDirectory(aDemFile)+'maskeditmasks.txt';
|
FSampleEditMaskFilename := CleanAndExpandFilename(FSampleEditMaskFilename);
|
||||||
if FileExistsUTF8(aDemFile) then
|
if (FSampleEditMaskFilename <> '') and FileExistsUTF8(FSampleEditMaskFilename) then
|
||||||
LoadDEMFile(aDemFile);
|
LoadAndCleanSampleFile(FSampleEditMaskFilename, FEnableSets, SampleMasksListBox.Items, ParsedSamples);
|
||||||
IDEDialogLayoutList.ApplyLayout(Self);
|
IDEDialogLayoutList.ApplyLayout(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMaskEditorForm.FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
procedure TMaskEditorForm.FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||||
begin
|
begin
|
||||||
|
PropEditConfigs.SampleEditMaskFilename := FSampleEditMaskFilename;
|
||||||
|
PropEditConfigs.Save;
|
||||||
IDEDialogLayoutList.SaveLayout(Self);
|
IDEDialogLayoutList.SaveLayout(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMaskEditorForm.UnloadSampleMasksButtonClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
SampleMasksListBox.Clear;
|
||||||
|
ParsedSamples := nil;
|
||||||
|
FSampleEditMaskFilename := '';
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMaskEditorForm.EnableSetsCheckBoxClick(Sender: TObject);
|
procedure TMaskEditorForm.EnableSetsCheckBoxClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
SetEnableSets(EnableSetsCheckBox.Checked);
|
SetEnableSets(EnableSetsCheckBox.Checked);
|
||||||
@ -147,9 +160,9 @@ end;
|
|||||||
|
|
||||||
procedure TMaskEditorForm.LoadSampleMasksButtonClick(Sender: TObject);
|
procedure TMaskEditorForm.LoadSampleMasksButtonClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
OpenDialog1.InitialDir:=ExtractFileDir(ParamStrUTF8(0));
|
OpenDialog1.InitialDir:=ExtractFileDir(FSampleEditMaskFilename);
|
||||||
if OpenDialog1.Execute then
|
if OpenDialog1.Execute then
|
||||||
LoadDEMFile(OpenDialog1.FileName);
|
LoadAndCleanSampleFile(OpenDialog1.Filename, FEnableSets, SampleMasksListBox.Items, ParsedSamples);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMaskEditorForm.SampleMasksListBoxDrawItem(Control: TWinControl;
|
procedure TMaskEditorForm.SampleMasksListBoxDrawItem(Control: TWinControl;
|
||||||
@ -374,6 +387,7 @@ var
|
|||||||
SL: TStringList;
|
SL: TStringList;
|
||||||
ParseFunc: TParseFunc;
|
ParseFunc: TParseFunc;
|
||||||
begin
|
begin
|
||||||
|
FSampleEditMaskFilename := '';
|
||||||
AParsedSamples := nil;
|
AParsedSamples := nil;
|
||||||
if (CompareText(ExtractFileExt(Fn),'.dem') = 0) then
|
if (CompareText(ExtractFileExt(Fn),'.dem') = 0) then
|
||||||
ParseFunc := @ParseMaskLineDelphi
|
ParseFunc := @ParseMaskLineDelphi
|
||||||
@ -403,11 +417,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
SetLength(AParsedSamples, Index);
|
SetLength(AParsedSamples, Index);
|
||||||
|
FSampleEditMaskFilename := Fn;
|
||||||
except
|
except
|
||||||
on ESTreamError do
|
on ESTreamError do
|
||||||
begin
|
begin
|
||||||
List.Clear;
|
List.Clear;
|
||||||
AParsedSamples := nil;
|
AParsedSamples := nil;
|
||||||
|
FSampleEditMaskFilename := '';
|
||||||
MessageDlg(Format(oisErrorReadingSampleFile,[Fn]), mtError, [mbOk], 0);
|
MessageDlg(Format(oisErrorReadingSampleFile,[Fn]), mtError, [mbOk], 0);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -417,10 +433,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMaskEditorForm.LoadDEMFile(AFileName: string);
|
|
||||||
begin
|
|
||||||
LoadAndCleanSampleFile(AFilename, FEnableSets, SampleMasksListBox.Items, ParsedSamples);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMaskEditorForm.SetEditMask(AValue: string);
|
procedure TMaskEditorForm.SetEditMask(AValue: string);
|
||||||
|
|
||||||
|
@ -257,6 +257,8 @@ resourcestring
|
|||||||
// Mask Editor
|
// Mask Editor
|
||||||
sccsMaskEditor = 'Edit Mask Editor ...';
|
sccsMaskEditor = 'Edit Mask Editor ...';
|
||||||
oisMasks = 'Masks ...';
|
oisMasks = 'Masks ...';
|
||||||
|
oisUnload = 'Unload';
|
||||||
|
oisUnloadHint = 'Unloads the current sample file';
|
||||||
oisInputMaskEditor = 'Input Mask Editor';
|
oisInputMaskEditor = 'Input Mask Editor';
|
||||||
oisSaveLiteralCharacters = 'Save Literal Characters';
|
oisSaveLiteralCharacters = 'Save Literal Characters';
|
||||||
oisInputMask = 'Input Mask:';
|
oisInputMask = 'Input Mask:';
|
||||||
|
140
components/ideintf/propeditconfig.pp
Normal file
140
components/ideintf/propeditconfig.pp
Normal file
@ -0,0 +1,140 @@
|
|||||||
|
{
|
||||||
|
/***************************************************************************
|
||||||
|
propeditconfig.pp
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
***************************************************************************
|
||||||
|
* *
|
||||||
|
* This source is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This code is distributed in the hope that it will be useful, but *
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||||
|
* General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* A copy of the GNU General Public License is available on the World *
|
||||||
|
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
|
||||||
|
* obtain it by writing to the Free Software Foundation, *
|
||||||
|
* Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1335, USA. *
|
||||||
|
* *
|
||||||
|
***************************************************************************
|
||||||
|
|
||||||
|
Author: Bart Broersma
|
||||||
|
|
||||||
|
Abstract:
|
||||||
|
Miscellaneous config settings for property editors.
|
||||||
|
Currently just for MaskEdit property editor.
|
||||||
|
|
||||||
|
}
|
||||||
|
unit PropEditConfig;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
// RTL + LCL
|
||||||
|
Classes, SysUtils,
|
||||||
|
// LazUtils
|
||||||
|
LazFileUtils, LazLoggerBase, LazUTF8, Laz2_XMLCfg,
|
||||||
|
// IdeIntf
|
||||||
|
LazIDEIntf;
|
||||||
|
|
||||||
|
const
|
||||||
|
DefaultFilename = 'propeditconfig.xml';
|
||||||
|
PropEditConfigVersion = 0;
|
||||||
|
pSampleMaskEditFile = 'MaskEdit/SampleEditMaskFile';
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TPropEditConfigs }
|
||||||
|
|
||||||
|
TPropEditConfigs = class
|
||||||
|
private
|
||||||
|
FFilename: String;
|
||||||
|
FSampleEditMaskFilename: String;
|
||||||
|
protected
|
||||||
|
procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string);
|
||||||
|
procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string);
|
||||||
|
public
|
||||||
|
constructor Create;
|
||||||
|
procedure Load;
|
||||||
|
procedure Save;
|
||||||
|
|
||||||
|
property Filename: String read FFilename;
|
||||||
|
property SampleEditMaskFilename: string read FSampleEditMaskFilename write FSampleEditMaskFilename;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
var
|
||||||
|
PropEditConfigs: TPropEditConfigs = nil; // do NOT free yourself, it'll be auto-destroyed at finalization
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{ TPropEditConfigs }
|
||||||
|
|
||||||
|
procedure TPropEditConfigs.LoadFromXMLConfig(XMLConfig: TXMLConfig;
|
||||||
|
const Path: string);
|
||||||
|
begin
|
||||||
|
FSampleEditMaskFilename := XMLConfig.GetValue(Path + pSampleMaskEditFile,'');
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TPropEditConfigs.SaveToXMLConfig(XMLConfig: TXMLConfig;
|
||||||
|
const Path: string);
|
||||||
|
begin
|
||||||
|
XMLConfig.SetValue(Path + pSampleMaskEditFile,FSampleEditMaskFilename);
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor TPropEditConfigs.Create;
|
||||||
|
begin
|
||||||
|
if Assigned(LazarusIDE) then
|
||||||
|
FFilename := AppendPathDelim(LazarusIDE.GetPrimaryConfigPath) + DefaultFilename;
|
||||||
|
//if IDE does not exist, FFilename will be empty string, in effect making Load and Save silently fail
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TPropEditConfigs.Load;
|
||||||
|
var
|
||||||
|
XMLConfig: TXMLConfig;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
XMLConfig := TXMLConfig.Create(FFileName);
|
||||||
|
LoadFromXMLConfig(XMLConfig,'PropEditConfig/');
|
||||||
|
XMLConfig.Free;
|
||||||
|
except
|
||||||
|
on E: Exception do
|
||||||
|
begin
|
||||||
|
DebugLn('[TPropEditConfigs.Load] error reading "',FFilename,'" ',E.Message);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TPropEditConfigs.Save;
|
||||||
|
var
|
||||||
|
XMLConfig: TXMLConfig;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
InvalidateFileStateCache;
|
||||||
|
XMLConfig:=TXMLConfig.CreateClean(FFileName);
|
||||||
|
|
||||||
|
XMLConfig.SetDeleteValue('PropEditConfig/PropEditConfigVersion/',PropEditConfigVersion,0);
|
||||||
|
SaveToXMLConfig(XMLConfig,'PropEditConfig/');
|
||||||
|
XMLConfig.Flush;
|
||||||
|
XMLConfig.Free;
|
||||||
|
except
|
||||||
|
on E: Exception do
|
||||||
|
begin
|
||||||
|
DebugLn('[TInputHistories.Save] error writing "',FFilename,'" ',E.Message);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
finalization
|
||||||
|
if Assigned(PropEditConfigs) then
|
||||||
|
FreeandNil(PropEditConfigs);
|
||||||
|
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user