├── .gitignore ├── LICENSE ├── Packages ├── 101B │ ├── ResourceEditorComponents.dpk │ └── ResourceEditorComponents.dproj ├── 102T │ ├── ResourceEditorComponents.dpk │ └── ResourceEditorComponents.dproj ├── 103R │ ├── ResourceEditorComponents.dpk │ └── ResourceEditorComponents.dproj ├── 10S │ ├── ResourceEditorComponents.dpk │ └── ResourceEditorComponents.dproj ├── D2006 │ ├── ResourceEditorComponents100.bdsproj │ ├── ResourceEditorComponents100.dpk │ └── ResourceEditorComponents100.res ├── D2010 │ ├── ResourceEditorComponents.dpk │ └── ResourceEditorComponents.dproj ├── XE2 │ ├── ResourceEditorComponents.dpk │ └── ResourceEditorComponents.dproj ├── XE6 │ ├── ResourceEditorComponents.dpk │ └── ResourceEditorComponents.dproj ├── XE7 │ ├── ResourceEditorComponents.dpk │ └── ResourceEditorComponents.dproj └── XE8 │ ├── ResourceEditorComponents.dpk │ └── ResourceEditorComponents.dproj ├── README.md └── Source ├── AcceleratorResourceForm.dfm ├── AcceleratorResourceForm.pas ├── AddResourceDialog.dfm ├── AddResourceDialog.pas ├── CloneResourceDialog.dfm ├── CloneResourceDialog.pas ├── Components ├── BitmapEditorCursors.res ├── ComponentBitmapEditor.pas ├── ComponentCWRichEdit.pas ├── ComponentCWSpellChecker.pas ├── ComponentColorSelector.pas ├── ComponentDialogBox.pas ├── ComponentDialogEditor.pas ├── ComponentExSplitter.pas ├── ComponentExWebBrowser.pas ├── ComponentFakeCombobox.pas ├── ComponentGradientShape.pas ├── ComponentHexDump.pas ├── ComponentHyperlinkButton.pas ├── ComponentMRUList.pas ├── ComponentMenuDesigner.pas ├── ComponentMessageDisplay.pas ├── ComponentNTAboutBox.dfm ├── ComponentNTAboutBox.pas ├── ComponentPersistentOptions.pas ├── ComponentPersistentPosition.pas ├── ComponentPropertyListBox.pas ├── ComponentRuler.pas ├── ComponentSizingPageControl.pas ├── ComponentSpellChecker.pas ├── ComponentStandardSystemMenu.pas ├── DialogButtonControls.pas ├── DialogComboBoxControls.pas ├── DialogConsts.pas ├── DialogEditControls.pas ├── DialogHotkeyControls.pas ├── DialogListViewControls.pas ├── DialogListboxControls.pas ├── DialogProgressBarControls.pas ├── DialogScrollbarControls.pas ├── DialogSliderControls.pas ├── DialogStaticControls.pas ├── DialogStrings.pas ├── DialogUpDownControls.pas ├── ExVirtualStringTree.pas ├── GIFImage.pas ├── GraphFlip.pas ├── MiscUnitsReg.dcr ├── MultiLanguage_tlb.pas ├── ResourceEditorComponentsReg.pas ├── RichOle.pas ├── SpellCheckerForm.dfm ├── SpellCheckerForm.pas ├── unitBTree.pas ├── unitCExpression.pas ├── unitCharsetMap.pas ├── unitClipExRegistry.pas ├── unitDefRegistry.pas ├── unitEXGraphics.pas ├── unitExIcon.pas ├── unitExRegistry.pas ├── unitHTMLHelp.pas ├── unitHTMLHelpViewer.pas ├── unitHTMLStringsDisplayObject.pas ├── unitNTModule.pas ├── unitObjectCache.pas ├── unitPEFile.pas ├── unitParser.pas ├── unitRCFile.pas ├── unitResFile.pas ├── unitResourceAccelerator.pas ├── unitResourceDetails.pas ├── unitResourceDialogs.pas ├── unitResourceExaminer.pas ├── unitResourceGIF.pas ├── unitResourceGraphics.pas ├── unitResourceHTML.pas ├── unitResourceJPEG.pas ├── unitResourceMenus.pas ├── unitResourceMessages.pas ├── unitResourcePNG.pas ├── unitResourceRCData.pas ├── unitResourceToolbar.pas ├── unitResourceVersionInfo.pas ├── unitResourceXPManifests.pas ├── unitSearchString.pas ├── unitStreamTextReader.pas └── unitVersionInfo.pas ├── CursorGraphicsResourceForm.dfm ├── CursorGraphicsResourceForm.pas ├── DescriptionRCDataResourceForm.dfm ├── DescriptionRCDataResourceForm.pas ├── DialogResourceForm.dfm ├── DialogResourceForm.pas ├── FormResourceForm.dfm ├── FormResourceForm.pas ├── FormTextInput.dfm ├── FormTextInput.pas ├── GraphicsResourceForm.dfm ├── GraphicsResourceForm.pas ├── GroupResourceForm.dfm ├── GroupResourceForm.pas ├── HelpContext.pas ├── IconCursorGraphicsResourceForm.dfm ├── IconCursorGraphicsResourceForm.pas ├── IconGraphicsResourceForm.dfm ├── IconGraphicsResourceForm.pas ├── MainForm.dfm ├── MainForm.pas ├── MenuResourceForm.dfm ├── MenuResourceForm.pas ├── PackagesResourceForm.dfm ├── PackagesResourceForm.pas ├── PropertiesForm.dfm ├── PropertiesForm.pas ├── PropertyBaseForm.dfm ├── PropertyBaseForm.pas ├── PropertyPageForm.dfm ├── PropertyPageForm.pas ├── PropertyPageProgramSettings.dfm ├── PropertyPageProgramSettings.pas ├── PropertyPageRCSettings.dfm ├── PropertyPageRCSettings.pas ├── RawResourceForm.dfm ├── RawResourceForm.pas ├── ResourceForm.dfm ├── ResourceForm.pas ├── ResourceObjectForm.dfm ├── ResourceObjectForm.pas ├── ResourcePropertiesDialog.dfm ├── ResourcePropertiesDialog.pas ├── TextResourceForm.dfm ├── TextResourceForm.pas ├── VersionResourceForm.dfm ├── VersionResourceForm.pas ├── XN.ico ├── XNResourceEditor.bdsproj ├── XNResourceEditor.dpr ├── XNResourceEditor.res ├── XPManifestResourceForm.dfm ├── XPManifestResourceForm.pas ├── grad.res ├── i.res ├── unitCREdProperties.pas ├── unitIncludePathPackages.pas └── unitIncludePaths.pas /.gitignore: -------------------------------------------------------------------------------- 1 | /DCU 2 | -------------------------------------------------------------------------------- /Packages/101B/ResourceEditorComponents.dpk: -------------------------------------------------------------------------------- 1 | package ResourceEditorComponents; 2 | 3 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} 4 | {$ALIGN 8} 5 | {$ASSERTIONS ON} 6 | {$BOOLEVAL OFF} 7 | {$DEBUGINFO OFF} 8 | {$EXTENDEDSYNTAX ON} 9 | {$IMPORTEDDATA ON} 10 | {$IOCHECKS ON} 11 | {$LOCALSYMBOLS ON} 12 | {$LONGSTRINGS ON} 13 | {$OPENSTRINGS ON} 14 | {$OPTIMIZATION ON} 15 | {$OVERFLOWCHECKS OFF} 16 | {$RANGECHECKS OFF} 17 | {$REFERENCEINFO ON} 18 | {$SAFEDIVIDE OFF} 19 | {$STACKFRAMES OFF} 20 | {$TYPEDADDRESS OFF} 21 | {$VARSTRINGCHECKS ON} 22 | {$WRITEABLECONST OFF} 23 | {$MINENUMSIZE 1} 24 | {$IMAGEBASE $400000} 25 | {$DEFINE DEBUG} 26 | {$ENDIF IMPLICITBUILDING} 27 | {$DESCRIPTION 'Resource Editor Components'} 28 | {$LIBSUFFIX '101B'} 29 | {$IMPLICITBUILD OFF} 30 | 31 | requires 32 | rtl, 33 | vcl; 34 | 35 | contains 36 | ResourceEditorComponentsReg in '..\..\Source\Components\ResourceEditorComponentsReg.pas', 37 | cmpBitmapEditor in '..\..\Source\Components\cmpBitmapEditor.pas', 38 | cmpDialogBox in '..\..\Source\Components\cmpDialogBox.pas', 39 | cmpDialogEditor in '..\..\Source\Components\cmpDialogEditor.pas', 40 | cmpGradientShape in '..\..\Source\Components\cmpGradientShape.pas', 41 | cmpMenuDesigner in '..\..\Source\Components\cmpMenuDesigner.pas', 42 | DialogButtonControls in '..\..\Source\Components\DialogButtonControls.pas', 43 | DialogComboBoxControls in '..\..\Source\Components\DialogComboBoxControls.pas', 44 | DialogConsts in '..\..\Source\Components\DialogConsts.pas', 45 | DialogEditControls in '..\..\Source\Components\DialogEditControls.pas', 46 | DialogHotkeyControls in '..\..\Source\Components\DialogHotkeyControls.pas', 47 | DialogListboxControls in '..\..\Source\Components\DialogListboxControls.pas', 48 | DialogListViewControls in '..\..\Source\Components\DialogListViewControls.pas', 49 | DialogProgressBarControls in '..\..\Source\Components\DialogProgressBarControls.pas', 50 | DialogScrollbarControls in '..\..\Source\Components\DialogScrollbarControls.pas', 51 | DialogSliderControls in '..\..\Source\Components\DialogSliderControls.pas', 52 | DialogStaticControls in '..\..\Source\Components\DialogStaticControls.pas', 53 | DialogStrings in '..\..\Source\Components\DialogStrings.pas', 54 | DialogUpDownControls in '..\..\Source\Components\DialogUpDownControls.pas', 55 | GIFImage in '..\..\Source\Components\GIFImage.pas', 56 | GraphFlip in '..\..\Source\Components\GraphFlip.pas', 57 | MMPropZLIB in '..\..\Source\Components\MMPropZLIB.pas', 58 | unitExIcon in '..\..\Source\Components\unitExIcon.pas', 59 | XFace in '..\..\Source\Components\XFace.pas'; 60 | 61 | end. 62 | -------------------------------------------------------------------------------- /Packages/102T/ResourceEditorComponents.dpk: -------------------------------------------------------------------------------- 1 | package ResourceEditorComponents; 2 | 3 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} 4 | {$ALIGN 8} 5 | {$ASSERTIONS ON} 6 | {$BOOLEVAL OFF} 7 | {$DEBUGINFO OFF} 8 | {$EXTENDEDSYNTAX ON} 9 | {$IMPORTEDDATA ON} 10 | {$IOCHECKS ON} 11 | {$LOCALSYMBOLS ON} 12 | {$LONGSTRINGS ON} 13 | {$OPENSTRINGS ON} 14 | {$OPTIMIZATION ON} 15 | {$OVERFLOWCHECKS OFF} 16 | {$RANGECHECKS OFF} 17 | {$REFERENCEINFO ON} 18 | {$SAFEDIVIDE OFF} 19 | {$STACKFRAMES OFF} 20 | {$TYPEDADDRESS OFF} 21 | {$VARSTRINGCHECKS ON} 22 | {$WRITEABLECONST OFF} 23 | {$MINENUMSIZE 1} 24 | {$IMAGEBASE $400000} 25 | {$DEFINE DEBUG} 26 | {$ENDIF IMPLICITBUILDING} 27 | {$DESCRIPTION 'Resource Editor Components'} 28 | {$LIBSUFFIX '102T'} 29 | {$IMPLICITBUILD OFF} 30 | 31 | requires 32 | rtl, 33 | vcl, 34 | vclie, 35 | vclimg, 36 | VirtualTreesR; 37 | 38 | contains 39 | ResourceEditorComponentsReg in '..\..\Source\Components\ResourceEditorComponentsReg.pas', 40 | ComponentBitmapEditor in '..\..\Source\Components\ComponentBitmapEditor.pas', 41 | ComponentColorSelector in '..\..\Source\Components\ComponentColorSelector.pas', 42 | ComponentCWRichEdit in '..\..\Source\Components\ComponentCWRichEdit.pas', 43 | ComponentCWSpellChecker in '..\..\Source\Components\ComponentCWSpellChecker.pas', 44 | ComponentDialogBox in '..\..\Source\Components\ComponentDialogBox.pas', 45 | ComponentDialogEditor in '..\..\Source\Components\ComponentDialogEditor.pas', 46 | ComponentExSplitter in '..\..\Source\Components\ComponentExSplitter.pas', 47 | ComponentExWebBrowser in '..\..\Source\Components\ComponentExWebBrowser.pas', 48 | ComponentFakeCombobox in '..\..\Source\Components\ComponentFakeCombobox.pas', 49 | ComponentGradientShape in '..\..\Source\Components\ComponentGradientShape.pas', 50 | ComponentHexDump in '..\..\Source\Components\ComponentHexDump.pas', 51 | ComponentHyperlinkButton in '..\..\Source\Components\ComponentHyperlinkButton.pas', 52 | ComponentMenuDesigner in '..\..\Source\Components\ComponentMenuDesigner.pas', 53 | ComponentMessageDisplay in '..\..\Source\Components\ComponentMessageDisplay.pas', 54 | ComponentMRUList in '..\..\Source\Components\ComponentMRUList.pas', 55 | ComponentNTAboutBox in '..\..\Source\Components\ComponentNTAboutBox.pas' {fmNTAboutBox}, 56 | ComponentPersistentOptions in '..\..\Source\Components\ComponentPersistentOptions.pas', 57 | ComponentPersistentPosition in '..\..\Source\Components\ComponentPersistentPosition.pas', 58 | ComponentPropertyListBox in '..\..\Source\Components\ComponentPropertyListBox.pas', 59 | ComponentRuler in '..\..\Source\Components\ComponentRuler.pas', 60 | ComponentSizingPageControl in '..\..\Source\Components\ComponentSizingPageControl.pas', 61 | ComponentSpellChecker in '..\..\Source\Components\ComponentSpellChecker.pas', 62 | ComponentStandardSystemMenu in '..\..\Source\Components\ComponentStandardSystemMenu.pas', 63 | DialogButtonControls in '..\..\Source\Components\DialogButtonControls.pas', 64 | DialogComboBoxControls in '..\..\Source\Components\DialogComboBoxControls.pas', 65 | DialogConsts in '..\..\Source\Components\DialogConsts.pas', 66 | DialogEditControls in '..\..\Source\Components\DialogEditControls.pas', 67 | DialogHotkeyControls in '..\..\Source\Components\DialogHotkeyControls.pas', 68 | DialogListboxControls in '..\..\Source\Components\DialogListboxControls.pas', 69 | DialogListViewControls in '..\..\Source\Components\DialogListViewControls.pas', 70 | DialogProgressBarControls in '..\..\Source\Components\DialogProgressBarControls.pas', 71 | DialogScrollbarControls in '..\..\Source\Components\DialogScrollbarControls.pas', 72 | DialogSliderControls in '..\..\Source\Components\DialogSliderControls.pas', 73 | DialogStaticControls in '..\..\Source\Components\DialogStaticControls.pas', 74 | DialogStrings in '..\..\Source\Components\DialogStrings.pas', 75 | DialogUpDownControls in '..\..\Source\Components\DialogUpDownControls.pas', 76 | ExVirtualStringTree in '..\..\Source\Components\ExVirtualStringTree.pas', 77 | GIFImage in '..\..\Source\Components\GIFImage.pas', 78 | GraphFlip in '..\..\Source\Components\GraphFlip.pas', 79 | MultiLanguage_TLB in '..\..\Source\Components\MultiLanguage_TLB.pas', 80 | RichOle in '..\..\Source\Components\RichOle.pas', 81 | SpellCheckerForm in '..\..\Source\Components\SpellCheckerForm.pas' {fmSpellChecker}, 82 | unitBTree in '..\..\Source\Components\unitBTree.pas', 83 | unitCExpression in '..\..\Source\Components\unitCExpression.pas', 84 | unitCharsetMap in '..\..\Source\Components\unitCharsetMap.pas', 85 | unitClipExRegistry in '..\..\Source\Components\unitClipExRegistry.pas', 86 | unitDefRegistry in '..\..\Source\Components\unitDefRegistry.pas', 87 | unitExGraphics in '..\..\Source\Components\unitExGraphics.pas', 88 | unitExIcon in '..\..\Source\Components\unitExIcon.pas', 89 | unitExRegistry in '..\..\Source\Components\unitExRegistry.pas', 90 | unitHTMLHelp in '..\..\Source\Components\unitHTMLHelp.pas', 91 | unitHTMLHelpViewer in '..\..\Source\Components\unitHTMLHelpViewer.pas', 92 | unitHTMLStringsDisplayObject in '..\..\Source\Components\unitHTMLStringsDisplayObject.pas', 93 | unitObjectCache in '..\..\Source\Components\unitObjectCache.pas', 94 | unitParser in '..\..\Source\Components\unitParser.pas', 95 | unitPEFile in '..\..\Source\Components\unitPEFile.pas', 96 | unitRCFile in '..\..\Source\Components\unitRCFile.pas', 97 | unitResFile in '..\..\Source\Components\unitResFile.pas', 98 | unitResourceAccelerator in '..\..\Source\Components\unitResourceAccelerator.pas', 99 | unitResourceDialogs in '..\..\Source\Components\unitResourceDialogs.pas', 100 | unitResourceDetails in '..\..\Source\Components\unitResourceDetails.pas', 101 | unitResourceExaminer in '..\..\Source\Components\unitResourceExaminer.pas', 102 | unitResourceGIF in '..\..\Source\Components\unitResourceGIF.pas', 103 | unitResourceGraphics in '..\..\Source\Components\unitResourceGraphics.pas', 104 | unitResourceHTML in '..\..\Source\Components\unitResourceHTML.pas', 105 | unitResourceJPEG in '..\..\Source\Components\unitResourceJPEG.pas', 106 | unitResourceMenus in '..\..\Source\Components\unitResourceMenus.pas', 107 | unitResourceMessages in '..\..\Source\Components\unitResourceMessages.pas', 108 | unitResourcePNG in '..\..\Source\Components\unitResourcePNG.pas', 109 | unitResourceRCData in '..\..\Source\Components\unitResourceRCData.pas', 110 | unitResourceToolbar in '..\..\Source\Components\unitResourceToolbar.pas', 111 | unitResourceVersionInfo in '..\..\Source\Components\unitResourceVersionInfo.pas', 112 | unitResourceXPManifests in '..\..\Source\Components\unitResourceXPManifests.pas', 113 | unitSearchString in '..\..\Source\Components\unitSearchString.pas', 114 | unitStreamTextReader in '..\..\Source\Components\unitStreamTextReader.pas', 115 | unitVersionInfo in '..\..\Source\Components\unitVersionInfo.pas'; 116 | 117 | end. 118 | -------------------------------------------------------------------------------- /Packages/103R/ResourceEditorComponents.dpk: -------------------------------------------------------------------------------- 1 | package ResourceEditorComponents; 2 | 3 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} 4 | {$ALIGN 8} 5 | {$ASSERTIONS ON} 6 | {$BOOLEVAL OFF} 7 | {$DEBUGINFO OFF} 8 | {$EXTENDEDSYNTAX ON} 9 | {$IMPORTEDDATA ON} 10 | {$IOCHECKS ON} 11 | {$LOCALSYMBOLS ON} 12 | {$LONGSTRINGS ON} 13 | {$OPENSTRINGS ON} 14 | {$OPTIMIZATION ON} 15 | {$OVERFLOWCHECKS OFF} 16 | {$RANGECHECKS OFF} 17 | {$REFERENCEINFO ON} 18 | {$SAFEDIVIDE OFF} 19 | {$STACKFRAMES OFF} 20 | {$TYPEDADDRESS OFF} 21 | {$VARSTRINGCHECKS ON} 22 | {$WRITEABLECONST OFF} 23 | {$MINENUMSIZE 1} 24 | {$IMAGEBASE $400000} 25 | {$DEFINE DEBUG} 26 | {$ENDIF IMPLICITBUILDING} 27 | {$DESCRIPTION 'Resource Editor Components'} 28 | {$LIBSUFFIX '103R'} 29 | {$IMPLICITBUILD OFF} 30 | 31 | requires 32 | rtl, 33 | vcl; 34 | 35 | contains 36 | ResourceEditorComponentsReg in '..\..\Source\Components\ResourceEditorComponentsReg.pas', 37 | cmpBitmapEditor in '..\..\Source\Components\cmpBitmapEditor.pas', 38 | cmpDialogBox in '..\..\Source\Components\cmpDialogBox.pas', 39 | cmpDialogEditor in '..\..\Source\Components\cmpDialogEditor.pas', 40 | cmpGradientShape in '..\..\Source\Components\cmpGradientShape.pas', 41 | cmpMenuDesigner in '..\..\Source\Components\cmpMenuDesigner.pas', 42 | DialogButtonControls in '..\..\Source\Components\DialogButtonControls.pas', 43 | DialogComboBoxControls in '..\..\Source\Components\DialogComboBoxControls.pas', 44 | DialogConsts in '..\..\Source\Components\DialogConsts.pas', 45 | DialogEditControls in '..\..\Source\Components\DialogEditControls.pas', 46 | DialogHotkeyControls in '..\..\Source\Components\DialogHotkeyControls.pas', 47 | DialogListboxControls in '..\..\Source\Components\DialogListboxControls.pas', 48 | DialogListViewControls in '..\..\Source\Components\DialogListViewControls.pas', 49 | DialogProgressBarControls in '..\..\Source\Components\DialogProgressBarControls.pas', 50 | DialogScrollbarControls in '..\..\Source\Components\DialogScrollbarControls.pas', 51 | DialogSliderControls in '..\..\Source\Components\DialogSliderControls.pas', 52 | DialogStaticControls in '..\..\Source\Components\DialogStaticControls.pas', 53 | DialogStrings in '..\..\Source\Components\DialogStrings.pas', 54 | DialogUpDownControls in '..\..\Source\Components\DialogUpDownControls.pas', 55 | GIFImage in '..\..\Source\Components\GIFImage.pas', 56 | GraphFlip in '..\..\Source\Components\GraphFlip.pas', 57 | MMPropZLIB in '..\..\Source\Components\MMPropZLIB.pas', 58 | unitExIcon in '..\..\Source\Components\unitExIcon.pas', 59 | XFace in '..\..\Source\Components\XFace.pas'; 60 | 61 | end. 62 | -------------------------------------------------------------------------------- /Packages/10S/ResourceEditorComponents.dpk: -------------------------------------------------------------------------------- 1 | package ResourceEditorComponents; 2 | 3 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} 4 | {$ALIGN 8} 5 | {$ASSERTIONS ON} 6 | {$BOOLEVAL OFF} 7 | {$DEBUGINFO OFF} 8 | {$EXTENDEDSYNTAX ON} 9 | {$IMPORTEDDATA ON} 10 | {$IOCHECKS ON} 11 | {$LOCALSYMBOLS ON} 12 | {$LONGSTRINGS ON} 13 | {$OPENSTRINGS ON} 14 | {$OPTIMIZATION ON} 15 | {$OVERFLOWCHECKS OFF} 16 | {$RANGECHECKS OFF} 17 | {$REFERENCEINFO ON} 18 | {$SAFEDIVIDE OFF} 19 | {$STACKFRAMES OFF} 20 | {$TYPEDADDRESS OFF} 21 | {$VARSTRINGCHECKS ON} 22 | {$WRITEABLECONST OFF} 23 | {$MINENUMSIZE 1} 24 | {$IMAGEBASE $400000} 25 | {$DEFINE DEBUG} 26 | {$ENDIF IMPLICITBUILDING} 27 | {$DESCRIPTION 'Resource Editor Components'} 28 | {$LIBSUFFIX '10S'} 29 | {$IMPLICITBUILD OFF} 30 | 31 | requires 32 | rtl, 33 | vcl; 34 | 35 | contains 36 | ResourceEditorComponentsReg in '..\..\Source\Components\ResourceEditorComponentsReg.pas', 37 | cmpBitmapEditor in '..\..\Source\Components\cmpBitmapEditor.pas', 38 | cmpDialogBox in '..\..\Source\Components\cmpDialogBox.pas', 39 | cmpDialogEditor in '..\..\Source\Components\cmpDialogEditor.pas', 40 | cmpGradientShape in '..\..\Source\Components\cmpGradientShape.pas', 41 | cmpMenuDesigner in '..\..\Source\Components\cmpMenuDesigner.pas', 42 | DialogButtonControls in '..\..\Source\Components\DialogButtonControls.pas', 43 | DialogComboBoxControls in '..\..\Source\Components\DialogComboBoxControls.pas', 44 | DialogConsts in '..\..\Source\Components\DialogConsts.pas', 45 | DialogEditControls in '..\..\Source\Components\DialogEditControls.pas', 46 | DialogHotkeyControls in '..\..\Source\Components\DialogHotkeyControls.pas', 47 | DialogListboxControls in '..\..\Source\Components\DialogListboxControls.pas', 48 | DialogListViewControls in '..\..\Source\Components\DialogListViewControls.pas', 49 | DialogProgressBarControls in '..\..\Source\Components\DialogProgressBarControls.pas', 50 | DialogScrollbarControls in '..\..\Source\Components\DialogScrollbarControls.pas', 51 | DialogSliderControls in '..\..\Source\Components\DialogSliderControls.pas', 52 | DialogStaticControls in '..\..\Source\Components\DialogStaticControls.pas', 53 | DialogStrings in '..\..\Source\Components\DialogStrings.pas', 54 | DialogUpDownControls in '..\..\Source\Components\DialogUpDownControls.pas', 55 | GIFImage in '..\..\Source\Components\GIFImage.pas', 56 | GraphFlip in '..\..\Source\Components\GraphFlip.pas', 57 | MMPropZLIB in '..\..\Source\Components\MMPropZLIB.pas', 58 | unitExIcon in '..\..\Source\Components\unitExIcon.pas', 59 | XFace in '..\..\Source\Components\XFace.pas'; 60 | 61 | end. 62 | -------------------------------------------------------------------------------- /Packages/D2006/ResourceEditorComponents100.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Packages/D2006/ResourceEditorComponents100.res -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # XN Resource Editor 2 | This is an unofficial mirror of XN Resource Editor. I created it since the files are no longer available from the author. 3 | 4 | Please see the website for more details: https://stefansundin.github.io/xn_resource_editor/ 5 | 6 | ## Important Note! 7 | Unfortuately the source code in this repository is not the latest by the original author. It is recommended to rather use https://github.com/zuloloxi/XN-Resource-Editor instead 8 | -------------------------------------------------------------------------------- /Source/AcceleratorResourceForm.dfm: -------------------------------------------------------------------------------- 1 | inherited FormAcceleratorResource: TFormAcceleratorResource 2 | Left = 283 3 | Top = 201 4 | ActiveControl = ListViewAccelerator 5 | Caption = 'FormAcceleratorResource' 6 | OnCreate = FormCreate 7 | PixelsPerInch = 96 8 | TextHeight = 13 9 | object ListViewAccelerator: TListView 10 | Left = 0 11 | Top = 0 12 | Width = 701 13 | Height = 455 14 | Align = alClient 15 | BorderStyle = bsNone 16 | Columns = < 17 | item 18 | Caption = 'ID' 19 | Width = 100 20 | end 21 | item 22 | Caption = 'Key' 23 | Width = 100 24 | end 25 | item 26 | Caption = 'Type' 27 | Width = 100 28 | end> 29 | ColumnClick = False 30 | GridLines = True 31 | RowSelect = True 32 | PopupMenu = PopupMenuAccel 33 | TabOrder = 0 34 | ViewStyle = vsReport 35 | OnDblClick = ListViewAcceleratorDblClick 36 | OnEdited = ListViewAcceleratorEdited 37 | OnEditing = ListViewAcceleratorEditing 38 | end 39 | object ComboBoxKey: TComboBox 40 | Left = 104 41 | Top = 16 42 | Width = 97 43 | Height = 21 44 | TabOrder = 1 45 | Text = 'ComboBoxKey' 46 | Visible = False 47 | OnChange = ComboBoxKeyChange 48 | OnExit = ComboBoxKeyExit 49 | end 50 | object ComboBoxType: TComboBox 51 | Left = 200 52 | Top = 16 53 | Width = 97 54 | Height = 21 55 | TabOrder = 2 56 | Text = 'ComboBoxType' 57 | Visible = False 58 | OnChange = ComboBoxTypeChange 59 | OnExit = ComboBoxTypeExit 60 | end 61 | object ActionList: TActionList 62 | Left = 496 63 | Top = 32 64 | object ActionAccelAdd: TAction 65 | Category = 'Accelerators' 66 | Caption = '&Add Accelerator' 67 | ShortCut = 45 68 | OnExecute = ActionAccelAddExecute 69 | end 70 | object ActionAccelDelete: TAction 71 | Category = 'Accelerators' 72 | Caption = '&Delete Accelerator' 73 | ShortCut = 46 74 | OnExecute = ActionAccelDeleteExecute 75 | end 76 | object ActionAccelModify: TAction 77 | Category = 'Accelerators' 78 | Caption = '&Modify Accelerator' 79 | OnExecute = ActionAccelModifyExecute 80 | end 81 | object ActionAccelChangeID: TAction 82 | Category = 'Accelerators' 83 | Caption = '&Change ID' 84 | OnExecute = ActionAccelChangeIDExecute 85 | end 86 | object ActionAccelChangeFlags: TAction 87 | Category = 'Accelerators' 88 | Caption = 'Change &Type' 89 | OnExecute = ActionAccelChangeFlagsExecute 90 | end 91 | end 92 | object PopupMenuAccel: TPopupMenu 93 | Left = 496 94 | Top = 80 95 | object MenuItemAddAccelerator: TMenuItem 96 | Action = ActionAccelAdd 97 | end 98 | object MenuItemModifyAccelerator: TMenuItem 99 | Action = ActionAccelModify 100 | end 101 | object MenuItemDeleteAccelerator: TMenuItem 102 | Action = ActionAccelDelete 103 | end 104 | object MenuItemChangeID: TMenuItem 105 | Action = ActionAccelChangeID 106 | end 107 | object MenuItemChangeFlags: TMenuItem 108 | Action = ActionAccelChangeFlags 109 | end 110 | end 111 | object MainMenuAccelMenu: TMainMenu 112 | Left = 496 113 | Top = 128 114 | object MenuItemAccelerators: TMenuItem 115 | Caption = 'Accelerators' 116 | object MenuItemChangeAddAccelerator2: TMenuItem 117 | Action = ActionAccelAdd 118 | end 119 | object MenuItemChangeModifyAccelerator2: TMenuItem 120 | Action = ActionAccelModify 121 | end 122 | object MenuItemChangeDeleteAccelerator2: TMenuItem 123 | Action = ActionAccelDelete 124 | end 125 | object MenuItemChangeChangeID2: TMenuItem 126 | Action = ActionAccelChangeID 127 | end 128 | object MenuItemChangeFlags2: TMenuItem 129 | Action = ActionAccelChangeFlags 130 | end 131 | end 132 | end 133 | end 134 | -------------------------------------------------------------------------------- /Source/AddResourceDialog.dfm: -------------------------------------------------------------------------------- 1 | object DialogAddResource: TDialogAddResource 2 | Left = 268 3 | Top = 226 4 | HelpContext = 1000 5 | Caption = 'Add Resource' 6 | ClientHeight = 325 7 | ClientWidth = 286 8 | Color = clBtnFace 9 | Font.Charset = DEFAULT_CHARSET 10 | Font.Color = clWindowText 11 | Font.Height = -11 12 | Font.Name = 'MS Sans Serif' 13 | Font.Style = [] 14 | OldCreateOrder = False 15 | Position = poMainFormCenter 16 | OnCreate = FormCreate 17 | OnResize = FormResize 18 | DesignSize = ( 19 | 286 20 | 325) 21 | PixelsPerInch = 96 22 | TextHeight = 13 23 | object ListView: TListView 24 | Left = 16 25 | Top = 16 26 | Width = 250 27 | Height = 256 28 | Anchors = [akLeft, akTop, akRight, akBottom] 29 | Columns = < 30 | item 31 | Caption = 'Resource' 32 | Width = -2 33 | WidthType = ( 34 | -2) 35 | end> 36 | ReadOnly = True 37 | RowSelect = True 38 | ShowColumnHeaders = False 39 | SmallImages = fmMain.ilResources 40 | TabOrder = 0 41 | ViewStyle = vsReport 42 | OnDblClick = ListViewDblClick 43 | end 44 | object ButtonOK: TButton 45 | Left = 106 46 | Top = 280 47 | Width = 75 48 | Height = 26 49 | Anchors = [akRight, akBottom] 50 | Caption = 'OK' 51 | Default = True 52 | ModalResult = 1 53 | TabOrder = 1 54 | OnClick = ButtonOKClick 55 | end 56 | object ButtonCancel: TButton 57 | Left = 190 58 | Top = 280 59 | Width = 75 60 | Height = 26 61 | Anchors = [akRight, akBottom] 62 | Cancel = True 63 | Caption = 'Cancel' 64 | ModalResult = 2 65 | TabOrder = 2 66 | end 67 | end 68 | -------------------------------------------------------------------------------- /Source/AddResourceDialog.pas: -------------------------------------------------------------------------------- 1 | unit AddResourceDialog; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 | ComCtrls, StdCtrls, unitResourceDetails, unitResourceJPEG; 8 | 9 | type 10 | TDialogAddResource = class(TForm) 11 | ListView: TListView; 12 | ButtonOK: TButton; 13 | ButtonCancel: TButton; 14 | procedure FormCreate(Sender: TObject); 15 | procedure ButtonOKClick(Sender: TObject); 16 | procedure ListViewDblClick(Sender: TObject); 17 | procedure FormResize(Sender: TObject); 18 | private 19 | FResourceDetailsClass: TResourceDetailsClass; 20 | public 21 | property ResourceDetailsClass : TResourceDetailsClass read FResourceDetailsClass; 22 | end; 23 | 24 | implementation 25 | 26 | uses 27 | MainForm, unitResourceGraphics, unitResourceMessages, unitResourceDialogs, 28 | unitResourceMenus, unitResourceXPManifests, unitResourceGIF, 29 | unitResourceVersionInfo, unitResourceToolbar, unitResourceAccelerator, 30 | unitResourceExaminer; 31 | 32 | {$R *.DFM} 33 | 34 | const 35 | CAddableItems : array [0..13] of TResourceDetailsClass = ( 36 | TCursorGroupResourceDetails, 37 | TBitmapResourceDetails, 38 | TIconGroupResourceDetails, 39 | TDIBResourceDetails, 40 | TStringResourceDetails, 41 | TMessageResourceDetails, 42 | TMenuResourceDetails, 43 | TDialogResourceDetails, 44 | TJPegResourceDetails, 45 | TGIFResourceDetails, 46 | TXPManifestResourceDetails, 47 | TVersionInfoResourceDetails, 48 | TToolbarResourceDetails, 49 | TAcceleratorResourceDetails 50 | ); 51 | 52 | procedure TDialogAddResource.FormCreate(Sender: TObject); 53 | var 54 | i: Integer; 55 | begin 56 | for i := Low(CAddableItems) to High(CAddableItems) do 57 | with ListView.Items.Add do 58 | begin 59 | Caption := GetTypeName(CAddableItems[i].GetBaseType); 60 | ImageIndex := GetTypeImage(CAddableItems[i].GetBaseType); 61 | end 62 | end; 63 | 64 | procedure TDialogAddResource.ButtonOKClick(Sender: TObject); 65 | begin 66 | if Assigned(ListView.Selected) then 67 | FResourceDetailsClass := CAddableItems[ListView.Selected.Index] 68 | else 69 | FResourceDetailsClass := Nil 70 | end; 71 | 72 | procedure TDialogAddResource.ListViewDblClick(Sender: TObject); 73 | begin 74 | ButtonOKClick(Self); 75 | modalResult := mrOK; 76 | end; 77 | 78 | procedure TDialogAddResource.FormResize(Sender: TObject); 79 | begin 80 | ListView.Columns[0].Width := ListView.Width - 16; 81 | end; 82 | 83 | end. 84 | -------------------------------------------------------------------------------- /Source/CloneResourceDialog.dfm: -------------------------------------------------------------------------------- 1 | object DialogCloneResource: TDialogCloneResource 2 | Left = 0 3 | Top = 0 4 | Caption = 'Clone Resource' 5 | ClientHeight = 185 6 | ClientWidth = 340 7 | Color = clBtnFace 8 | Constraints.MaxHeight = 212 9 | Constraints.MinHeight = 212 10 | Constraints.MinWidth = 275 11 | Font.Charset = DEFAULT_CHARSET 12 | Font.Color = clWindowText 13 | Font.Height = -11 14 | Font.Name = 'MS Sans Serif' 15 | Font.Style = [] 16 | OldCreateOrder = False 17 | Position = poMainFormCenter 18 | OnShow = FormShow 19 | DesignSize = ( 20 | 340 21 | 185) 22 | PixelsPerInch = 96 23 | TextHeight = 13 24 | object LabelDescription: TLabel 25 | Left = 16 26 | Top = 16 27 | Width = 305 28 | Height = 33 29 | Anchors = [akLeft, akTop, akRight] 30 | AutoSize = False 31 | Caption = 'Please specify a new name or language for the cloned resource' 32 | WordWrap = True 33 | end 34 | object ComboBoxLanguage: TComboBox 35 | Left = 96 36 | Top = 108 37 | Width = 226 38 | Height = 21 39 | Anchors = [akLeft, akTop, akRight] 40 | Sorted = True 41 | TabOrder = 2 42 | end 43 | object ButtonOK: TButton 44 | Left = 169 45 | Top = 146 46 | Width = 75 47 | Height = 25 48 | Anchors = [akRight, akBottom] 49 | Caption = 'OK' 50 | Default = True 51 | ModalResult = 1 52 | TabOrder = 3 53 | end 54 | object ButtonCancel: TButton 55 | Left = 247 56 | Top = 146 57 | Width = 75 58 | Height = 25 59 | Anchors = [akRight, akBottom] 60 | Cancel = True 61 | Caption = 'Cancel' 62 | ModalResult = 2 63 | TabOrder = 4 64 | end 65 | object RadioButtonByName: TRadioButton 66 | Left = 16 67 | Top = 70 68 | Width = 65 69 | Height = 17 70 | Caption = '&Name' 71 | Checked = True 72 | TabOrder = 0 73 | TabStop = True 74 | end 75 | object RadioButtonByLanguage: TRadioButton 76 | Left = 16 77 | Top = 110 78 | Width = 73 79 | Height = 17 80 | Caption = '&Language' 81 | TabOrder = 1 82 | end 83 | object EditName: TEdit 84 | Left = 96 85 | Top = 68 86 | Width = 225 87 | Height = 21 88 | Anchors = [akLeft, akTop, akRight] 89 | TabOrder = 5 90 | end 91 | end 92 | -------------------------------------------------------------------------------- /Source/CloneResourceDialog.pas: -------------------------------------------------------------------------------- 1 | unit CloneResourceDialog; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 7 | Dialogs, StdCtrls, unitResourceDetails; 8 | 9 | type 10 | TDialogCloneResource = class(TForm) 11 | ComboBoxLanguage: TComboBox; 12 | ButtonOK: TButton; 13 | ButtonCancel: TButton; 14 | RadioButtonByName: TRadioButton; 15 | RadioButtonByLanguage: TRadioButton; 16 | LabelDescription: TLabel; 17 | EditName: TEdit; 18 | procedure FormShow(Sender: TObject); 19 | private 20 | function GetLanguage: LCID; 21 | protected 22 | procedure UpdateActions; override; 23 | public 24 | ResourceDetails: TResourceDetails; 25 | 26 | property Language: LCID read GetLanguage; 27 | end; 28 | 29 | implementation 30 | 31 | {$R *.dfm} 32 | 33 | uses 34 | unitResourceMessages, ResourceForm; 35 | 36 | resourcestring 37 | rstNeutral = 'Language Neutral'; 38 | 39 | procedure TDialogCloneResource.FormShow(Sender: TObject); 40 | var 41 | i: Integer; 42 | def: string; 43 | begin 44 | UseInternationalFont(EditName.Font); 45 | if Assigned(ResourceDetails) then 46 | begin 47 | if ResourceDetails is TStringResourceDetails then 48 | EditName.Text := ResIdToStringsId (ResourceDetails.ResourceName) 49 | else 50 | EditName.Text := ResourceDetails.ResourceName; 51 | end; 52 | 53 | ComboBoxLanguage.Items.Add ('- ' + rstNeutral); 54 | def := '-'; 55 | 56 | for i := 0 to Languages.Count - 1 do 57 | begin 58 | ComboBoxLanguage.Items.Add (Languages.Name [i]); 59 | if Assigned(ResourceDetails) and (ResourceDetails.ResourceLanguage <> 0) and (DWORD (ResourceDetails.ResourceLanguage) = Languages.LocaleID [i]) then 60 | def := Languages.Name [i]; 61 | end; 62 | 63 | if def = '-' then 64 | ComboBoxLanguage.ItemIndex := 0 65 | else 66 | ComboBoxLanguage.Text := def; 67 | end; 68 | 69 | function TDialogCloneResource.GetLanguage: LCID; 70 | var 71 | i: Integer; 72 | begin 73 | Result := 0; 74 | if ComboBoxLanguage.ItemIndex <> 0 then 75 | for i := 0 to Languages.Count - 1 do 76 | if Languages.Name [i] = ComboBoxLanguage.Text then 77 | begin 78 | Result := Languages.LocaleID[i]; 79 | Break 80 | end 81 | end; 82 | 83 | procedure TDialogCloneResource.UpdateActions; 84 | begin 85 | EditName.Enabled := RadioButtonByName.Checked; 86 | ComboBoxLanguage.Enabled := RadioButtonByLanguage.Checked; 87 | end; 88 | 89 | end. 90 | -------------------------------------------------------------------------------- /Source/Components/BitmapEditorCursors.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/Components/BitmapEditorCursors.res -------------------------------------------------------------------------------- /Source/Components/ComponentCWRichEdit.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/Components/ComponentCWRichEdit.pas -------------------------------------------------------------------------------- /Source/Components/ComponentCWSpellChecker.pas: -------------------------------------------------------------------------------- 1 | unit ComponentCWSpellChecker; 2 | 3 | interface 4 | 5 | uses 6 | SysUtils, Classes, Controls, ComponentSpellChecker, ComponentCWRichEdit; 7 | 8 | type 9 | TCWSpellChecker = class(TSpellChecker) 10 | private 11 | FEXRichEdit: TCustomExRichEdit; 12 | protected 13 | public 14 | destructor Destroy; override; 15 | function CheckAndShowModal (SkipFirstLine: Boolean): Integer; 16 | published 17 | property ExRichEdit: TCustomExRichEdit read FEXRichEdit write FEXRichEdit; 18 | end; 19 | 20 | implementation 21 | 22 | uses 23 | SpellCheckerForm; 24 | 25 | { TCWSpellChecker } 26 | 27 | function TCWSpellChecker.CheckAndShowModal (SkipFirstLine: Boolean): Integer; 28 | var 29 | ss, se: Integer; 30 | Txt: WideString; 31 | Suggestions: TStrings; 32 | begin 33 | Result := mrOK; 34 | if not Assigned(ExRichEdit) then Exit; 35 | if Assigned(fmSpellChecker) then Exit; 36 | 37 | Txt := ExRichEdit.Text; 38 | Suggestions := TStringList.Create; 39 | try 40 | if not Check(Txt, 1, ss, se, Suggestions, SkipFirstLine) then 41 | begin 42 | fmSpellChecker := TfmSpellChecker.Create(Owner); 43 | fmSpellChecker.QuoteChars := QuoteChars; 44 | fmSpellChecker.Initialize(Self, ss, se, Suggestions); 45 | Result := fmSpellChecker.ShowModal; 46 | end 47 | finally 48 | Suggestions.Free 49 | end 50 | end; 51 | 52 | destructor TCWSpellChecker.Destroy; 53 | begin 54 | if Assigned(fmSpellChecker) then 55 | fmSpellChecker.Close; 56 | 57 | inherited; 58 | end; 59 | 60 | end. 61 | -------------------------------------------------------------------------------- /Source/Components/ComponentDialogEditor.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/Components/ComponentDialogEditor.pas -------------------------------------------------------------------------------- /Source/Components/ComponentGradientShape.pas: -------------------------------------------------------------------------------- 1 | unit ComponentGradientShape; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Messages, Classes, SysUtils, Controls, Graphics; 7 | 8 | type 9 | TCustomGradientShape = class(TGraphicControl) 10 | private 11 | FPen: TPen; 12 | FStartColor: TColor; 13 | procedure SetPen(const Value: TPen); 14 | procedure SetStartColor(const Value: TColor); 15 | procedure WMEraseBkgnd(var Message: TWmEraseBkgnd); message WM_ERASEBKGND; 16 | protected 17 | procedure StyleChanged(Sender: TObject); virtual; 18 | property Pen: TPen read FPen write SetPen; 19 | property StartColor: TColor read FStartColor write SetStartColor; 20 | public 21 | constructor Create(AOwner: TComponent); override; 22 | destructor Destroy; override; 23 | end; 24 | 25 | TGradientShapeRectType = (gsrLR, gsrTB, gsrTLBR, gsrBLTR); 26 | 27 | TCustomGradientShapeRect = class(TCustomGradientShape) 28 | private 29 | FRectType: TGradientShapeRectType; 30 | procedure SetRectType(const Value: TGradientShapeRectType); 31 | protected 32 | procedure Paint; override; 33 | 34 | property RectType: TGradientShapeRectType read FRectType write SetRectType; 35 | end; 36 | 37 | TGradientShapeRect = class(TCustomGradientShapeRect) 38 | published 39 | property Color; 40 | property RectType; 41 | property StartColor; 42 | end; 43 | 44 | procedure GradientRect(dc: HDC; rectType: TGradientShapeRectType; l, t, r, b: Integer; startColor, endColor: DWORD); 45 | 46 | implementation 47 | 48 | procedure GradientRect(dc: HDC; rectType: TGradientShapeRectType; l, t, r, b: Integer; startColor, endColor: DWORD); 49 | var 50 | Vertex: array [0..3] of TriVertex; 51 | gRect: GRADIENT_RECT; 52 | mode: DWORD; 53 | nVertices, nElements: Integer; 54 | gTria: array [0..1] of GRADIENT_TRIANGLE; 55 | p: Pointer; 56 | sr, sg, sb, er, eg, eb, ar, ag, ab: Integer; 57 | begin 58 | FillChar (Vertex, SizeOf(Vertex), 0); 59 | 60 | sr := GetRValue(ColorToRGB (startColor)); 61 | sg := GetGValue(ColorToRGB (startColor)); 62 | sb := GetBValue(ColorToRGB (startColor)); 63 | er := GetRValue(ColorToRGB (endColor)); 64 | eg := GetGValue(ColorToRGB (endColor)); 65 | eb := GetBValue(ColorToRGB (endColor)); 66 | 67 | if RectType in [gsrTLBR, gsrBLTR] then 68 | begin 69 | ar := sr shl 8 + (er - sr) shl 7; 70 | ag := sg shl 8 + (eg - sg) shl 7; 71 | ab := sb shl 8 + (eb - sb) shl 7; 72 | end 73 | else 74 | begin 75 | ar := 0; 76 | ag := 0; 77 | ab := 0 78 | end; 79 | 80 | sr := sr shl 8; 81 | sg := sg shl 8; 82 | sb := sb shl 8; 83 | 84 | er := er shl 8; 85 | eg := eg shl 8; 86 | eb := eb shl 8; 87 | 88 | Vertex [0].x := l; 89 | Vertex [0].y := t; 90 | 91 | Vertex [1].x := r; 92 | Vertex [1].y := b; 93 | 94 | if RectType = gsrBLTR then 95 | begin 96 | Vertex [0].Red := ar; 97 | Vertex [0].Green := ag; 98 | Vertex [0].Blue := ab; 99 | 100 | Vertex [1].Red := ar; 101 | Vertex [1].Green := ag; 102 | Vertex [1].Blue := ab; 103 | end 104 | else 105 | begin 106 | Vertex [0].Red := sr; 107 | Vertex [0].Green := sg; 108 | Vertex [0].Blue := sb; 109 | 110 | Vertex [1].Red := er; 111 | Vertex [1].Green := eg; 112 | Vertex [1].Blue := eb 113 | end; 114 | 115 | if RectType in [gsrLR, gsrTB] then 116 | begin 117 | nVertices := 2; 118 | nElements := 1; 119 | p := @gRect; 120 | gRect.UpperLeft := 0; 121 | gRect.LowerRight := 1; 122 | if RectType = gsrLR then 123 | mode := GRADIENT_FILL_RECT_H 124 | else 125 | mode := GRADIENT_FILL_RECT_V; 126 | end 127 | else 128 | begin 129 | nVertices := 4; 130 | nElements := 2; 131 | mode := GRADIENT_FILL_TRIANGLE; 132 | 133 | p := @gTria [0]; 134 | 135 | Vertex [2].x := r; 136 | Vertex [2].y := t; 137 | Vertex [3].x := l; 138 | Vertex [3].y := b; 139 | 140 | if RectType = gsrTLBR then 141 | begin 142 | gTria [0].Vertex1 := 0; 143 | gTria [0].Vertex2 := 2; 144 | gTria [0].Vertex3 := 3; 145 | gTria [1].Vertex1 := 3; 146 | gTria [1].Vertex2 := 2; 147 | gTria [1].Vertex3 := 1; 148 | 149 | Vertex [2].Red := ar; 150 | Vertex [2].Green := ag; 151 | Vertex [2].Blue := ab; 152 | 153 | Vertex [3].Red := ar; 154 | Vertex [3].Green := ag; 155 | Vertex [3].Blue := ab; 156 | end 157 | else 158 | begin 159 | gTria [0].Vertex1 := 3; 160 | gTria [0].Vertex2 := 1; 161 | gTria [0].Vertex3 := 0; 162 | gTria [1].Vertex1 := 0; 163 | gTria [1].Vertex2 := 1; 164 | gTria [1].Vertex3 := 2; 165 | 166 | Vertex [2].Red := er; 167 | Vertex [2].Green := eg; 168 | Vertex [2].Blue := eb; 169 | 170 | Vertex [3].Red := sr; 171 | Vertex [3].Green := sg; 172 | Vertex [3].Blue := sb; 173 | end 174 | end; 175 | 176 | GradientFill (dc, @Vertex [0], nVertices, p, nElements, mode); 177 | end; 178 | 179 | 180 | { TCustomGradientShape } 181 | 182 | constructor TCustomGradientShape.Create(AOwner: TComponent); 183 | begin 184 | inherited; 185 | ControlStyle := ControlStyle + [csReplicatable, csOpaque]; 186 | Width := 65; 187 | Height := 65; 188 | FPen := TPen.Create; 189 | FPen.OnChange := StyleChanged; 190 | end; 191 | 192 | destructor TCustomGradientShape.Destroy; 193 | begin 194 | inherited; 195 | end; 196 | 197 | procedure TCustomGradientShape.SetPen(const value: TPen); 198 | begin 199 | FPen.Assign(Value); 200 | end; 201 | 202 | procedure TCustomGradientShape.SetStartColor(const value: TColor); 203 | begin 204 | if FStartColor <> value then 205 | begin 206 | FStartColor := Value; 207 | Invalidate; 208 | end 209 | end; 210 | 211 | procedure TCustomGradientShape.StyleChanged(Sender: TObject); 212 | begin 213 | Invalidate; 214 | end; 215 | 216 | procedure TCustomGradientShape.WMEraseBkgnd(var Message: TWmEraseBkgnd); 217 | begin 218 | Message.Result := 1; 219 | end; 220 | 221 | 222 | { TCustomGradientShapeRect } 223 | 224 | procedure TCustomGradientShapeRect.Paint; 225 | begin 226 | GradientRect(Canvas.Handle, RectType, left, top, left + width, top + height, StartColor, color); 227 | end; 228 | 229 | procedure TCustomGradientShapeRect.SetRectType(const Value: TGradientShapeRectType); 230 | begin 231 | if Value <> FRectType then 232 | begin 233 | FRectType := Value; 234 | Invalidate; 235 | end; 236 | end; 237 | 238 | end. 239 | -------------------------------------------------------------------------------- /Source/Components/ComponentMRUList.pas: -------------------------------------------------------------------------------- 1 | unit ComponentMRUList; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Classes, SysUtils, Menus, Forms; 7 | 8 | type 9 | TMRUList = class(TComponent) 10 | private 11 | FMRU: TStringList; 12 | FManufacturer: string; 13 | FCapacity: Integer; 14 | FLoaded: Boolean; 15 | FPopupMenu: TPopupMenu; 16 | FOnPopupMenuClick: TNotifyEvent; 17 | FAppSection: string; 18 | FApplication: string; 19 | 20 | procedure SetManufacturer(const Value: string); 21 | procedure SetCapacity(const Value: Integer); 22 | function GetStrings: TStrings; 23 | procedure SetPopupMenu(const Value: TPopupMenu); 24 | procedure PopulateMenu; 25 | procedure PopupMenuItemOnClick(Sender: TObject); 26 | procedure SetAppSection(const Value: string); 27 | function GetMRUDirectory: string; 28 | function GetMRUFile: string; 29 | procedure SetApplication(const Value: string); 30 | protected 31 | function GetKeyName: string; virtual; 32 | 33 | public 34 | constructor Create(AOwner: TComponent); override; 35 | destructor Destroy; override; 36 | 37 | procedure AddFile(fileName: string); 38 | procedure SaveList; 39 | procedure LoadList; 40 | property Strings: TStrings read GetStrings; 41 | property MRUFile: string read GetMRUFile; 42 | property MRUDirectory: string read GetMRUDirectory; 43 | 44 | 45 | published 46 | property Manufacturer: string read FManufacturer write SetManufacturer; 47 | property Application: string read FApplication write SetApplication; 48 | property AppSection: string read FAppSection write SetAppSection; 49 | property Capacity: Integer read FCapacity write SetCapacity default 5; 50 | property PopupMenu: TPopupMenu read FPopupMenu write SetPopupMenu; 51 | 52 | property OnPopupMenuClick: TNotifyEvent read FOnPopupMenuClick write FOnPopupMenuClick; 53 | end; 54 | 55 | implementation 56 | 57 | uses 58 | Registry; 59 | 60 | { TMRUList } 61 | 62 | procedure TMRUList.AddFile(fileName: string); 63 | var 64 | idx: Integer; 65 | begin 66 | fileName := LowerCase(fileName); 67 | LoadList; 68 | idx := FMRU.IndexOf (fileName); 69 | if idx >= 0 then 70 | FMRU.Delete(idx); 71 | 72 | while FMRU.Count >= Capacity do 73 | FMRU.Delete(FMRU.Count - 1); 74 | 75 | FMRU.Insert(0, fileName); 76 | PopulateMenu 77 | end; 78 | 79 | constructor TMRUList.Create(AOwner: TComponent); 80 | begin 81 | inherited Create(AOwner); 82 | FMRU := TStringList.Create; 83 | FCapacity := 5 84 | end; 85 | 86 | destructor TMRUList.Destroy; 87 | begin 88 | if not (csDesigning in ComponentState) then 89 | SaveList; 90 | FMRU.Free; 91 | inherited; 92 | end; 93 | 94 | function TMRUList.GetKeyName: string; 95 | var 96 | app: string; 97 | begin 98 | if Application = '' then 99 | app := Forms.Application.Title 100 | else 101 | app := Application; 102 | Result := Format('SOFTWARE\%s\%s\Recent Files', [Manufacturer, Application]); 103 | if FAppSection <> '' then 104 | Result := Result + '\' + FAppSection 105 | end; 106 | 107 | function TMRUList.GetMRUDirectory: string; 108 | begin 109 | Result := ExtractFilePath(MRUFile) 110 | end; 111 | 112 | function TMRUList.GetMRUFile: string; 113 | begin 114 | if strings.Count > 0 then 115 | Result := strings[0] 116 | else 117 | Result := '' 118 | end; 119 | 120 | function TMRUList.GetStrings: TStrings; 121 | begin 122 | LoadList; 123 | Result := FMRU 124 | end; 125 | 126 | procedure TMRUList.LoadList; 127 | var 128 | values: TStringList; 129 | i: Integer; 130 | begin 131 | if not FLoaded then 132 | begin 133 | FMRU.Clear; 134 | if Manufacturer <> '' then 135 | with TRegistry.Create do 136 | try 137 | if OpenKeyReadOnly(GetKeyName) then 138 | begin 139 | values := TStringList.Create; 140 | try 141 | GetValueNames (values); 142 | for i := 0 to values.Count - 1 do 143 | FMRU.Add (ReadString (values[i])); 144 | finally 145 | values.Free 146 | end 147 | end 148 | finally 149 | Free 150 | end; 151 | FLoaded := True 152 | end 153 | end; 154 | 155 | procedure TMRUList.PopulateMenu; 156 | var 157 | i: Integer; 158 | item: TMenuItem; 159 | begin 160 | if not (csDesigning in ComponentState) then 161 | begin 162 | if Assigned(FPopupMenu) then 163 | begin 164 | FPopupMenu.Items.Clear; 165 | for i := 0 to Strings.Count - 1 do 166 | begin 167 | item := TMenuItem.Create(Self); 168 | item.Caption := '&' + IntToHex (i, 0) + ' ' + Strings[i]; 169 | item.OnClick := PopupMenuItemOnClick; 170 | PopupMenu.Items.Add (item) 171 | end 172 | end 173 | end 174 | end; 175 | 176 | procedure TMRUList.PopupMenuItemOnClick(Sender: TObject); 177 | begin 178 | if Assigned(OnPopupMenuClick) then 179 | OnPopupMenuClick(Sender); 180 | end; 181 | 182 | procedure TMRUList.SaveList; 183 | var 184 | i: Integer; 185 | begin 186 | if (Manufacturer <> '') and FLoaded then 187 | if FMRU.Count > 0 then 188 | with TRegistry.Create do 189 | try 190 | if OpenKey(GetKeyName, True) then 191 | for i := 0 to FMRU.Count - 1 do 192 | WriteString (Format('File %d', [i]), FMRU [i]) 193 | finally 194 | Free 195 | end 196 | else 197 | RegDeleteKey(HKEY_CURRENT_USER, PChar (GetKeyName)); 198 | end; 199 | 200 | procedure TMRUList.SetApplication(const Value: string); 201 | begin 202 | if FApplication <> value then 203 | begin 204 | SaveList; 205 | FApplication := Value; 206 | FLoaded := False 207 | end 208 | end; 209 | 210 | procedure TMRUList.SetAppSection(const Value: string); 211 | begin 212 | if FAppSection <> value then 213 | begin 214 | SaveList; 215 | FAppSection := Value; 216 | FLoaded := False 217 | end 218 | end; 219 | 220 | procedure TMRUList.SetCapacity(const Value: Integer); 221 | begin 222 | if Capacity <> value then 223 | begin 224 | FCapacity := Value 225 | end 226 | end; 227 | 228 | procedure TMRUList.SetManufacturer(const Value: string); 229 | begin 230 | if FManufacturer <> value then 231 | begin 232 | SaveList; 233 | FManufacturer := Value; 234 | FLoaded := False 235 | end 236 | end; 237 | 238 | procedure TMRUList.SetPopupMenu(const Value: TPopupMenu); 239 | begin 240 | if FPopupMenu <> value then 241 | begin 242 | FPopupMenu := value; 243 | PopulateMenu 244 | end 245 | end; 246 | 247 | end. 248 | -------------------------------------------------------------------------------- /Source/Components/ComponentMessageDisplay.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/Components/ComponentMessageDisplay.pas -------------------------------------------------------------------------------- /Source/Components/ComponentNTAboutBox.dfm: -------------------------------------------------------------------------------- 1 | object fmNTAboutBox: TfmNTAboutBox 2 | Left = 192 3 | Top = 224 4 | BorderStyle = bsDialog 5 | Caption = 'About' 6 | ClientHeight = 287 7 | ClientWidth = 371 8 | Color = clBtnFace 9 | Font.Charset = DEFAULT_CHARSET 10 | Font.Color = clWindowText 11 | Font.Height = -11 12 | Font.Name = 'MS Sans Serif' 13 | Font.Style = [] 14 | OldCreateOrder = True 15 | Position = poMainFormCenter 16 | OnShow = FormShow 17 | PixelsPerInch = 96 18 | TextHeight = 13 19 | object PageControl1: TPageControl 20 | Left = 0 21 | Top = 0 22 | Width = 371 23 | Height = 287 24 | ActivePage = TabSheet1 25 | Align = alClient 26 | TabOrder = 0 27 | object TabSheet1: TTabSheet 28 | Caption = 'TabSheet1' 29 | ExplicitLeft = 0 30 | ExplicitTop = 0 31 | ExplicitWidth = 0 32 | ExplicitHeight = 0 33 | object icoProduct: TImage 34 | Left = 8 35 | Top = 8 36 | Width = 65 37 | Height = 65 38 | AutoSize = True 39 | Center = True 40 | Stretch = True 41 | Transparent = True 42 | end 43 | object stProduct: TLabel 44 | Left = 80 45 | Top = 16 46 | Width = 281 47 | Height = 13 48 | AutoSize = False 49 | Caption = 'stProduct' 50 | ShowAccelChar = False 51 | end 52 | object stVersion: TLabel 53 | Left = 80 54 | Top = 32 55 | Width = 281 56 | Height = 13 57 | AutoSize = False 58 | Caption = 'stVersion' 59 | ShowAccelChar = False 60 | end 61 | object stCopyright: TLabel 62 | Left = 80 63 | Top = 48 64 | Width = 246 65 | Height = 13 66 | Caption = 'Copyright '#169' Colin Wilson 2003. All Rights Reserved' 67 | ShowAccelChar = False 68 | end 69 | object lblSupport: TLabel 70 | Left = 80 71 | Top = 64 72 | Width = 37 73 | Height = 13 74 | Caption = 'Support' 75 | Visible = False 76 | end 77 | object Label1: TLabel 78 | Left = 80 79 | Top = 96 80 | Width = 281 81 | Height = 13 82 | AutoSize = False 83 | Caption = 'This product is licensed to:' 84 | end 85 | object stLicense1: TLabel 86 | Left = 80 87 | Top = 112 88 | Width = 281 89 | Height = 13 90 | AutoSize = False 91 | Caption = 'stLicense1' 92 | ShowAccelChar = False 93 | end 94 | object stLicense2: TLabel 95 | Left = 80 96 | Top = 128 97 | Width = 51 98 | Height = 13 99 | Caption = 'stLicense2' 100 | ShowAccelChar = False 101 | end 102 | object Bevel1: TBevel 103 | Left = 80 104 | Top = 152 105 | Width = 281 106 | Height = 2 107 | Shape = bsBottomLine 108 | end 109 | object stMemAvail: TLabel 110 | Left = 80 111 | Top = 160 112 | Width = 281 113 | Height = 13 114 | AutoSize = False 115 | Caption = 'Physical Memory Available to Windows:' 116 | end 117 | object icoProduct1: TImage 118 | Left = 8 119 | Top = 184 120 | Width = 65 121 | Height = 65 122 | AutoSize = True 123 | Center = True 124 | Transparent = True 125 | end 126 | object hlbSupport: THyperlinkButton 127 | Left = 79 128 | Top = 220 129 | Width = 64 130 | Height = 16 131 | ImageIndex = 0 132 | SelectedFontColor = clBlack 133 | SelectedFontStyles = [] 134 | AutoLink = False 135 | InPlace = False 136 | end 137 | object OKBtn: TButton 138 | Left = 279 139 | Top = 220 140 | Width = 75 141 | Height = 25 142 | Caption = 'OK' 143 | ModalResult = 1 144 | TabOrder = 0 145 | end 146 | end 147 | object TabSheet2: TTabSheet 148 | Caption = 'Thank You!' 149 | ImageIndex = 1 150 | ExplicitLeft = 0 151 | ExplicitTop = 0 152 | ExplicitWidth = 0 153 | ExplicitHeight = 0 154 | object stThankYou: TLabel 155 | Left = 16 156 | Top = 16 157 | Width = 337 158 | Height = 33 159 | AutoSize = False 160 | WordWrap = True 161 | end 162 | object lbDonations: TListBox 163 | Left = 16 164 | Top = 56 165 | Width = 337 166 | Height = 185 167 | ItemHeight = 13 168 | TabOrder = 0 169 | end 170 | end 171 | end 172 | end 173 | -------------------------------------------------------------------------------- /Source/Components/ComponentPersistentOptions.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/Components/ComponentPersistentOptions.pas -------------------------------------------------------------------------------- /Source/Components/ComponentPersistentPosition.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/Components/ComponentPersistentPosition.pas -------------------------------------------------------------------------------- /Source/Components/ComponentPropertyListBox.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/Components/ComponentPropertyListBox.pas -------------------------------------------------------------------------------- /Source/Components/ComponentRuler.pas: -------------------------------------------------------------------------------- 1 | unit ComponentRuler; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs; 7 | 8 | type 9 | TRulerOrientation = (ruHorizontal, ruVertical); 10 | 11 | TRuler = class(TCustomControl) 12 | private 13 | FSmallTickSpacing: Integer; 14 | FSmallTickLength: Integer; 15 | FSmallTicksPerLargeTick: Integer; 16 | FLargeTickLength: Integer; 17 | FDialogBox: HWND; 18 | procedure SetLargeTickLength(const Value: Integer); 19 | procedure SetOrientation(const Value: TRulerOrientation); 20 | procedure SetSmallTickLength(const Value: Integer); 21 | procedure SetSmallTickSpacing(const Value: Integer); 22 | procedure SetSmallTicksperLargeTick(const Value: Integer); 23 | function GetOrientation: TRulerOrientation; 24 | procedure SetDialogBox(const Value: HWND); 25 | protected 26 | procedure Loaded; override; 27 | procedure Paint; override; 28 | public 29 | constructor Create(AOwner: TComponent); override; 30 | property DialogBox: HWND read FDialogBox write SetDialogBox; 31 | published 32 | property Align; 33 | property Anchors; 34 | property BevelKind default bkTile; 35 | property BevelInner default bvLowered; 36 | property BevelOuter default bvLowered; 37 | property BevelWidth; 38 | property Color; 39 | property Constraints; 40 | property ParentColor; 41 | 42 | property SmallTickSpacing: Integer read FSmallTickSpacing write SetSmallTickSpacing default 10; 43 | property SmallTicksPerLargeTick: Integer read FSmallTicksPerLargeTick write SetSmallTicksperLargeTick default 5; 44 | property SmallTickLength: Integer read FSmallTickLength write SetSmallTickLength default 5; 45 | property LargeTickLength: Integer read FLargeTickLength write SetLargeTickLength default 10; 46 | property Orientation: TRulerOrientation read GetOrientation write SetOrientation stored False; 47 | end; 48 | 49 | implementation 50 | 51 | { TRuler } 52 | 53 | constructor TRuler.Create(AOwner: TComponent); 54 | begin 55 | inherited Create(AOwner); 56 | Width := 180; 57 | Height := 40; 58 | BevelKind := bkTile; 59 | BevelInner := bvLowered; 60 | BevelOuter := bvLowered; 61 | FLargeTickLength := 10; 62 | FSmallTickLength := 5; 63 | FSmallTicksPerLargeTick := 5; 64 | FSmallTickSpacing := 10; 65 | end; 66 | 67 | function TRuler.GetOrientation: TRulerOrientation; 68 | begin 69 | if Width > Height then 70 | Result := ruHorizontal 71 | else 72 | Result := ruVertical 73 | end; 74 | 75 | procedure TRuler.Loaded; 76 | begin 77 | inherited; 78 | end; 79 | 80 | procedure TRuler.Paint; 81 | var 82 | x, y: Integer; 83 | w, h: Integer; 84 | t: Integer; 85 | sm: Integer; 86 | r: TRect; 87 | Offset: Integer; 88 | begin 89 | Canvas.Brush.Color := Color; 90 | Canvas.Font := Font; 91 | 92 | w := ClientWidth; 93 | h := ClientHeight; 94 | 95 | if FDialogBox <> 0 then 96 | sm := FSmallTickSpacing 97 | else 98 | sm := FSmallTickSpacing; 99 | 100 | y := 0; 101 | x := 0; 102 | Offset := 0; 103 | t := 0; 104 | 105 | if Orientation = ruHorizontal then 106 | begin 107 | repeat 108 | Inc(Offset, sm); 109 | if FDialogBox <> 0 then 110 | begin 111 | r := Rect(0, 0, Offset, 10); 112 | MapDialogRect(FDialogBox, r); 113 | x := r.Right; 114 | end 115 | else 116 | x := Offset; 117 | Inc(t); 118 | if x < w then 119 | begin 120 | Canvas.MoveTo(x, y); 121 | if t = FSmallTicksPerLargeTick then 122 | begin 123 | Canvas.LineTo(x, y + FLargeTickLength); 124 | t := 0; 125 | end 126 | else 127 | Canvas.LineTo(x, y + FSmallTickLength); 128 | end 129 | until x >= w; 130 | end 131 | else 132 | begin 133 | repeat 134 | Inc(Offset, sm); 135 | if FDialogBox <> 0 then 136 | begin 137 | r := Rect(0, 0, 10, Offset); 138 | MapDialogRect(FDialogBox, r); 139 | y := r.Bottom; 140 | end 141 | else 142 | y := Offset; 143 | 144 | Inc(t); 145 | if y < h then 146 | begin 147 | Canvas.MoveTo(x, y); 148 | if t = FSmallTicksPerLargeTick then 149 | begin 150 | Canvas.LineTo(x + FLargeTickLength, y); 151 | t := 0 152 | end 153 | else 154 | Canvas.LineTo(x + FSmallTickLength, y); 155 | end 156 | until y >= h; 157 | end 158 | end; 159 | 160 | procedure TRuler.SetDialogBox(const Value: HWND); 161 | begin 162 | FDialogBox := Value; 163 | Invalidate; 164 | end; 165 | 166 | procedure TRuler.SetLargeTickLength(const Value: Integer); 167 | begin 168 | if Value <> FLargeTickLength then 169 | begin 170 | FLargeTickLength := Value; 171 | Invalidate; 172 | end 173 | end; 174 | 175 | procedure TRuler.SetOrientation(const Value: TRulerOrientation); 176 | var 177 | h: Integer; 178 | begin 179 | if Value <> Orientation then 180 | begin 181 | h := Height; 182 | Height := Width; 183 | Width := h; 184 | Invalidate; 185 | end 186 | end; 187 | 188 | procedure TRuler.SetSmallTickLength(const Value: Integer); 189 | begin 190 | if Value <> FSmallTickLength then 191 | begin 192 | FSmallTickLength := Value; 193 | Invalidate; 194 | end 195 | end; 196 | 197 | procedure TRuler.SetSmallTickSpacing(const Value: Integer); 198 | begin 199 | if Value <> FSmallTickSpacing then 200 | begin 201 | FSmallTickSpacing := Value; 202 | Invalidate; 203 | end 204 | end; 205 | 206 | procedure TRuler.SetSmallTicksperLargeTick(const Value: Integer); 207 | begin 208 | if Value <> FSmallTicksPerLargeTick then 209 | begin 210 | FSmallTicksPerLargeTick := Value; 211 | Invalidate; 212 | end 213 | end; 214 | 215 | end. 216 | -------------------------------------------------------------------------------- /Source/Components/ComponentSizingPageControl.pas: -------------------------------------------------------------------------------- 1 | unit ComponentSizingPageControl; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 | ComCtrls; 8 | 9 | type 10 | TSizingPageControl = class(TPageControl) 11 | published 12 | property AutoSize; 13 | end; 14 | 15 | implementation 16 | 17 | end. 18 | -------------------------------------------------------------------------------- /Source/Components/ComponentSpellChecker.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/Components/ComponentSpellChecker.pas -------------------------------------------------------------------------------- /Source/Components/ComponentStandardSystemMenu.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/Components/ComponentStandardSystemMenu.pas -------------------------------------------------------------------------------- /Source/Components/DialogComboBoxControls.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/Components/DialogComboBoxControls.pas -------------------------------------------------------------------------------- /Source/Components/DialogConsts.pas: -------------------------------------------------------------------------------- 1 | unit DialogConsts; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Classes, SysUtils; 7 | 8 | const 9 | BUTTON_ID = $80; 10 | EDIT_ID = $81; 11 | STATIC_ID = $82; 12 | LISTBOX_ID = $83; 13 | SCROLLBAR_ID = $84; 14 | COMBOBOX_ID = $85; 15 | 16 | type 17 | TSZOrID = record 18 | isID : Boolean; 19 | sz : string; 20 | id : Integer; 21 | end; 22 | 23 | TDlgTemplateEx = packed record 24 | dlgVer : word; 25 | signature : word; 26 | helpID : DWORD; 27 | exStyle : DWORD; 28 | style : DWORD; 29 | cDlgItems : WORD; 30 | x, y, cx, cy : smallint; 31 | 32 | // Then follows menu, class, title sz or id 33 | 34 | // if DS_SETFONT in style then follows 35 | 36 | (* 37 | pointsize : Word; 38 | weight : Word; 39 | italic : Byte; 40 | charset : Byte; 41 | typeface : TszOrID; //(sz only!) 42 | *) 43 | 44 | end; 45 | 46 | PDlgTemplateEx = ^TDlgTemplateEx; 47 | 48 | TDlgItemTemplateEx = packed record 49 | helpID : DWORD; 50 | exStyle : DWORD; 51 | Style : DWORD; 52 | x : Smallint; 53 | y : Smallint; 54 | cx : Smallint; 55 | cy : Smallint; 56 | id : Word; 57 | 58 | // Then follows class and title sz or ID 59 | 60 | // Then follows extraCount : WORD, followed by creation data 61 | end; 62 | PDlgItemTemplateEx = ^TDlgItemTemplateEx; 63 | 64 | 65 | procedure WriteSzOrId (stream : TStream; const id : TSzOrId); 66 | function StringToSzOrID (const st : string) : TszOrID; 67 | procedure Pad (stream : TStream); 68 | 69 | implementation 70 | 71 | procedure WriteSzOrId (stream : TStream; const id : TSzOrId); 72 | var 73 | w : Word; 74 | ws : WideString; 75 | begin 76 | if id.isID then 77 | begin 78 | w := $ffff; 79 | stream.Write(w, SizeOf(w)); 80 | 81 | w := id.id; 82 | stream.Write(w, SizeOf(w)) 83 | end 84 | else 85 | begin 86 | ws := id.sz; 87 | stream.Write(ws[1], (Length(ws) + 1) * SizeOf(WideChar)) 88 | end 89 | end; 90 | 91 | function StringToSzOrID (const st : string) : TszOrID; 92 | var 93 | i : Integer; 94 | begin 95 | result.isID := True; 96 | result.sz := st; 97 | 98 | for i := 1 to Length(st) do 99 | if not (st [i] in ['0'..'9']) then 100 | begin 101 | result.isID := False; 102 | break 103 | end; 104 | 105 | if result.isID then 106 | begin 107 | result.id := StrToInt(st); 108 | if result.id > $ffff then 109 | result.isID := False 110 | end; 111 | 112 | if result.isID then 113 | result.sz := '' 114 | else 115 | result.id := 0 116 | end; 117 | 118 | procedure Pad (stream : TStream); 119 | var 120 | padding : Integer; 121 | begin 122 | if stream.Position mod 4 <> 0 then 123 | begin 124 | padding := 0; 125 | stream.Write(padding, 4 - (stream.Position mod 4)) 126 | end 127 | end; 128 | 129 | end. 130 | -------------------------------------------------------------------------------- /Source/Components/DialogHotkeyControls.pas: -------------------------------------------------------------------------------- 1 | unit DialogHotkeyControls; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Classes, SysUtils, CommCtrl, ComponentDialogEditor, DialogConsts; 7 | 8 | type 9 | THotkeyControlInfo = class (TStandardControlInfo) 10 | protected 11 | procedure Init; override; 12 | public 13 | class procedure CreateControlParams (var params : TCreateControlParams); override; 14 | class function GetDescription : string; override; 15 | function GetPropertyCount(kind: TPropertyKind): Integer; override; 16 | function GetPropertyEnumCount(kind: TPropertyKind; idx: Integer): Integer; override; 17 | function GetPropertyEnumName(kind: TPropertyKind; idx, enum: Integer): string; override; 18 | function GetPropertyName(kind: TPropertyKind; idx: Integer): string; override; 19 | function GetPropertyValue(kind: TPropertyKind; idx: Integer): Variant; override; 20 | function GetPropertyType(kind: TPropertyKind; idx: Integer): TPropertyType; override; 21 | procedure SetPropertyValue(kind: TPropertyKind; idx: Integer;const Value: Variant); override; 22 | end; 23 | 24 | implementation 25 | 26 | uses 27 | DialogStrings; 28 | 29 | const 30 | HotkeyControlPropertyGeneralCount = 0; 31 | HotkeyControlPropertyStyleCount = 0; 32 | HotkeyControlPropertyExtendedCount = 0; 33 | HotkeyControlPropertyCount : array [TPropertyKind] of Integer = (HotkeyControlPropertyGeneralCount, HotkeyControlPropertyStyleCount, HotkeyControlPropertyExtendedCount); 34 | // HotkeyControlPropertyGeneralName : array [0..HotkeyControlPropertyGeneralCount - 1] of string = (rstCaption); 35 | // HotkeyControlPropertyStyleName : array [0..HotkeyControlPropertyStyleCount - 1] of string = (rstVertical, rstPoint, rstTickMarks, rstAutoTicks, rstEnableSelection, rstThumb); 36 | // HotkeyControlPropertyExtendedName : array [0..HotkeyControlPropertyExtendedCount - 1] of string = (rstRTLReadingOrder, rstRightAlignedText); 37 | // HotkeyControlPropertyGeneralType : array [0..HotkeyControlPropertyGeneralCount - 1] of TPropertyType = (ptString); 38 | // HotkeyControlPropertyStyleType : array [0..HotkeyControlPropertyStyleCount - 1] of TPropertyType = (ptBoolean, ptEnum, ptBoolean, ptBoolean, ptBoolean, ptBoolean); 39 | // HotkeyControlPropertyExtendedType : array [0..HotkeyControlPropertyExtendedCount - 1] of TPropertyType = (ptBoolean, ptBoolean); 40 | 41 | { THotkeyControlInfo } 42 | 43 | class procedure THotkeyControlInfo.CreateControlParams( 44 | var params: TCreateControlParams); 45 | begin 46 | inherited; 47 | params.ExStyle := params.ExStyle; 48 | end; 49 | 50 | class function THotkeyControlInfo.GetDescription: string; 51 | begin 52 | Result := rstHotkey 53 | end; 54 | 55 | function THotkeyControlInfo.GetPropertyCount( 56 | kind: TPropertyKind): Integer; 57 | begin 58 | Result := inherited GetPropertyCount(kind) + HotkeyControlPropertyCount [kind] 59 | end; 60 | 61 | function THotkeyControlInfo.GetPropertyEnumCount(kind: TPropertyKind; 62 | idx: Integer): Integer; 63 | begin 64 | if idx < inherited GetPropertyCount(kind) then 65 | Result := inherited GetPropertyEnumCount(kind, idx) 66 | else 67 | begin 68 | Dec(idx, inherited GetPropertyCount(kind)); 69 | if idx = 1 then 70 | Result := 3 71 | else 72 | Result := 0; 73 | end 74 | end; 75 | 76 | function THotkeyControlInfo.GetPropertyEnumName(kind: TPropertyKind; idx, 77 | enum: Integer): string; 78 | begin 79 | if idx < inherited GetPropertyCount(kind) then 80 | Result := inherited GetPropertyEnumName(kind, idx, enum) 81 | else 82 | begin 83 | Dec(idx, inherited GetPropertyCount(kind)); 84 | if idx = 1 then 85 | case enum of 86 | 0 : Result := rstBoth; 87 | 1 : Result := rstTopLeft; 88 | 2 : Result := rstBottomRight; 89 | else 90 | Result := '' 91 | end 92 | else 93 | Result := '' 94 | end 95 | end; 96 | 97 | function THotkeyControlInfo.GetPropertyName(kind: TPropertyKind; 98 | idx: Integer): string; 99 | begin 100 | if idx < inherited GetPropertyCount(kind) then 101 | Result := inherited GetPropertyName(kind, idx) 102 | else 103 | begin 104 | // Dec(idx, inherited GetPropertyCount(kind)); 105 | Result := ''; 106 | (* case kind of 107 | // pkGeneral : Result := StaticControlPropertyGeneralName [idx]; 108 | // pkStyle : Result := HotkeyControlPropertyStyleName [idx]; 109 | // pkExtended : Result := StaticControlPropertyExtendedName [idx]; 110 | end 111 | *) 112 | end 113 | end; 114 | 115 | function THotkeyControlInfo.GetPropertyType(kind: TPropertyKind; 116 | idx: Integer): TPropertyType; 117 | begin 118 | if idx < inherited GetPropertyCount(kind) then 119 | Result := inherited GetPropertyType(kind, idx) 120 | else 121 | begin 122 | // Dec(idx, inherited GetPropertyCount(kind)); 123 | Result := ptInteger; 124 | (* 125 | case kind of 126 | // pkGeneral : Result := StaticControlPropertyGeneralType [idx]; 127 | // pkStyle : Result := HotkeyControlPropertyStyleType [idx]; 128 | // pkExtended : Result := StaticControlPropertyExtendedType [idx]; 129 | end 130 | *) 131 | end 132 | end; 133 | 134 | function THotkeyControlInfo.GetPropertyValue(kind: TPropertyKind; 135 | idx: Integer): Variant; 136 | begin 137 | if idx < inherited GetPropertyCount(kind) then 138 | Result := inherited GetPropertyValue(kind, idx) 139 | else 140 | begin 141 | // Dec(idx, inherited GetPropertyCount(kind)); 142 | end 143 | end; 144 | 145 | procedure THotkeyControlInfo.Init; 146 | begin 147 | inherited; 148 | 149 | SendMessage(ControlHandle, TBM_SETPOS, 66, 0); 150 | end; 151 | 152 | procedure THotkeyControlInfo.SetPropertyValue(kind: TPropertyKind; 153 | idx: Integer; const Value: Variant); 154 | var 155 | recreateRequired : Boolean; 156 | begin 157 | if idx < inherited GetPropertyCount(kind) then 158 | inherited SetPropertyValue(kind, idx, Value) 159 | else 160 | begin 161 | Dec(idx, inherited GetPropertyCount(kind)); 162 | recreateRequired := True; 163 | 164 | case kind of 165 | pkStyle : 166 | case idx of 167 | 0 : HasStyle [TBS_VERT] := Value; 168 | 1 : case Integer (Value) of 169 | 0 : SetMaskedStyle(TBS_BOTH, TBS_BOTH or TBS_LEFT); 170 | 1 : SetMaskedStyle(TBS_LEFT, TBS_BOTH or TBS_LEFT); 171 | 2 : SetMaskedStyle(0, TBS_BOTH or TBS_LEFT) 172 | end; 173 | 2 : HasStyle [TBS_NOTICKS] := not Boolean (Value); 174 | 3 : HasStyle [TBS_AUTOTICKS] := Value; 175 | 4 : HasStyle [TBS_ENABLESELRANGE] := Value; 176 | 5 : HasStyle [TBS_NOTHUMB] := not Boolean (Value); 177 | end 178 | end; 179 | 180 | if recreateRequired then 181 | RecreateWnd 182 | end 183 | end; 184 | 185 | end. 186 | -------------------------------------------------------------------------------- /Source/Components/DialogProgressBarControls.pas: -------------------------------------------------------------------------------- 1 | unit DialogProgressbarControls; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Classes, SysUtils, CommCtrl, ComponentDialogEditor, DialogConsts; 7 | 8 | type 9 | TProgressBarControlInfo = class (TStandardControlInfo) 10 | protected 11 | procedure Init; override; 12 | public 13 | class procedure CreateControlParams (var params : TCreateControlParams); override; 14 | class function GetDescription : string; override; 15 | function GetPropertyCount(kind: TPropertyKind): Integer; override; 16 | function GetPropertyEnumCount(kind: TPropertyKind; idx: Integer): Integer; override; 17 | function GetPropertyEnumName(kind: TPropertyKind; idx, enum: Integer): string; override; 18 | function GetPropertyName(kind: TPropertyKind; idx: Integer): string; override; 19 | function GetPropertyValue(kind: TPropertyKind; idx: Integer): Variant; override; 20 | function GetPropertyType(kind: TPropertyKind; idx: Integer): TPropertyType; override; 21 | procedure SetPropertyValue(kind: TPropertyKind; idx: Integer;const Value: Variant); override; 22 | end; 23 | 24 | implementation 25 | 26 | uses 27 | DialogStrings; 28 | 29 | const 30 | ProgressBarControlPropertyGeneralCount = 0; 31 | ProgressBarControlPropertyStyleCount = 2; 32 | ProgressBarControlPropertyExtendedCount = 0; 33 | ProgressBarControlPropertyCount : array [TPropertyKind] of Integer = (ProgressBarControlPropertyGeneralCount, ProgressBarControlPropertyStyleCount, ProgressBarControlPropertyExtendedCount); 34 | // ProgressBarControlPropertyGeneralName : array [0..ProgressBarControlPropertyGeneralCount - 1] of string = (rstCaption); 35 | ProgressBarControlPropertyStyleName : array [0..ProgressBarControlPropertyStyleCount - 1] of string = (rstVertical, rstSmooth); 36 | // ProgressBarControlPropertyExtendedName : array [0..ProgressBarControlPropertyExtendedCount - 1] of string = (rstRTLReadingOrder, rstRightAlignedText); 37 | // ProgressBarControlPropertyGeneralType : array [0..ProgressBarControlPropertyGeneralCount - 1] of TPropertyType = (ptString); 38 | ProgressBarControlPropertyStyleType : array [0..ProgressBarControlPropertyStyleCount - 1] of TPropertyType = (ptBoolean, ptBoolean); 39 | // ProgressBarControlPropertyExtendedType : array [0..ProgressBarControlPropertyExtendedCount - 1] of TPropertyType = (ptBoolean, ptBoolean); 40 | 41 | { TProgressBarControlInfo } 42 | 43 | class procedure TProgressBarControlInfo.CreateControlParams( 44 | var params: TCreateControlParams); 45 | begin 46 | inherited; 47 | params.ExStyle := params.ExStyle or WS_EX_CLIENTEDGE; 48 | end; 49 | 50 | class function TProgressBarControlInfo.GetDescription: string; 51 | begin 52 | Result := rstProgressBar 53 | end; 54 | 55 | function TProgressBarControlInfo.GetPropertyCount( 56 | kind: TPropertyKind): Integer; 57 | begin 58 | Result := inherited GetPropertyCount(kind) + ProgressBarControlPropertyCount [kind] 59 | end; 60 | 61 | function TProgressBarControlInfo.GetPropertyEnumCount(kind: TPropertyKind; 62 | idx: Integer): Integer; 63 | begin 64 | if idx < inherited GetPropertyCount(kind) then 65 | Result := inherited GetPropertyEnumCount(kind, idx) 66 | else 67 | begin 68 | // Dec(idx, inherited GetPropertyCount(kind)); 69 | Result := 0; 70 | end 71 | end; 72 | 73 | function TProgressBarControlInfo.GetPropertyEnumName(kind: TPropertyKind; idx, 74 | enum: Integer): string; 75 | begin 76 | if idx < inherited GetPropertyCount(kind) then 77 | Result := inherited GetPropertyEnumName(kind, idx, enum) 78 | else 79 | begin 80 | // Dec(idx, inherited GetPropertyCount(kind)); 81 | Result := ''; 82 | end 83 | end; 84 | 85 | function TProgressBarControlInfo.GetPropertyName(kind: TPropertyKind; 86 | idx: Integer): string; 87 | begin 88 | if idx < inherited GetPropertyCount(kind) then 89 | Result := inherited GetPropertyName(kind, idx) 90 | else 91 | begin 92 | Dec(idx, inherited GetPropertyCount(kind)); 93 | Result := ''; 94 | case kind of 95 | // pkGeneral : Result := StaticControlPropertyGeneralName [idx]; 96 | pkStyle : Result := ProgressBarControlPropertyStyleName [idx]; 97 | // pkExtended : Result := StaticControlPropertyExtendedName [idx]; 98 | end 99 | end 100 | end; 101 | 102 | function TProgressBarControlInfo.GetPropertyType(kind: TPropertyKind; 103 | idx: Integer): TPropertyType; 104 | begin 105 | if idx < inherited GetPropertyCount(kind) then 106 | Result := inherited GetPropertyType(kind, idx) 107 | else 108 | begin 109 | Dec(idx, inherited GetPropertyCount(kind)); 110 | Result := ptInteger; 111 | case kind of 112 | // pkGeneral : Result := StaticControlPropertyGeneralType [idx]; 113 | pkStyle : Result := ProgressBarControlPropertyStyleType [idx]; 114 | // pkExtended : Result := StaticControlPropertyExtendedType [idx]; 115 | end 116 | end 117 | end; 118 | 119 | function TProgressBarControlInfo.GetPropertyValue(kind: TPropertyKind; 120 | idx: Integer): Variant; 121 | begin 122 | if idx < inherited GetPropertyCount(kind) then 123 | Result := inherited GetPropertyValue(kind, idx) 124 | else 125 | begin 126 | Dec(idx, inherited GetPropertyCount(kind)); 127 | 128 | case kind of 129 | pkStyle : 130 | case idx of 131 | 0 : Result := HasStyle [PBS_VERTICAL]; 132 | 1 : Result := HasStyle [PBS_SMOOTH]; 133 | 2 : Result := HasStyle [WS_BORDER]; 134 | end 135 | end 136 | end 137 | end; 138 | 139 | procedure TProgressBarControlInfo.Init; 140 | begin 141 | inherited; 142 | 143 | SendMessage(ControlHandle, PBM_SETPOS, 66, 0); 144 | 145 | end; 146 | 147 | procedure TProgressBarControlInfo.SetPropertyValue(kind: TPropertyKind; 148 | idx: Integer; const Value: Variant); 149 | var 150 | recreateRequired : Boolean; 151 | begin 152 | if idx < inherited GetPropertyCount(kind) then 153 | inherited SetPropertyValue(kind, idx, Value) 154 | else 155 | begin 156 | Dec(idx, inherited GetPropertyCount(kind)); 157 | recreateRequired := True; 158 | 159 | case kind of 160 | pkStyle : 161 | case idx of 162 | 0 : HasStyle [PBS_VERTICAL] := Value; 163 | 1 : HasStyle [PBS_SMOOTH] := Value; 164 | end 165 | end; 166 | 167 | if recreateRequired then 168 | RecreateWnd 169 | end 170 | end; 171 | 172 | end. 173 | -------------------------------------------------------------------------------- /Source/Components/DialogScrollbarControls.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/Components/DialogScrollbarControls.pas -------------------------------------------------------------------------------- /Source/Components/DialogSliderControls.pas: -------------------------------------------------------------------------------- 1 | unit DialogSliderControls; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Classes, SysUtils, CommCtrl, ComponentDialogEditor, DialogConsts; 7 | 8 | type 9 | TSliderControlInfo = class (TStandardControlInfo) 10 | protected 11 | procedure Init; override; 12 | public 13 | class procedure CreateControlParams (var params : TCreateControlParams); override; 14 | class function GetDescription : string; override; 15 | function GetPropertyCount(kind: TPropertyKind): Integer; override; 16 | function GetPropertyEnumCount(kind: TPropertyKind; idx: Integer): Integer; override; 17 | function GetPropertyEnumName(kind: TPropertyKind; idx, enum: Integer): string; override; 18 | function GetPropertyName(kind: TPropertyKind; idx: Integer): string; override; 19 | function GetPropertyValue(kind: TPropertyKind; idx: Integer): Variant; override; 20 | function GetPropertyType(kind: TPropertyKind; idx: Integer): TPropertyType; override; 21 | procedure SetPropertyValue(kind: TPropertyKind; idx: Integer;const Value: Variant); override; 22 | end; 23 | 24 | implementation 25 | 26 | uses 27 | DialogStrings; 28 | 29 | const 30 | SliderControlPropertyGeneralCount = 0; 31 | SliderControlPropertyStyleCount = 6; 32 | SliderControlPropertyExtendedCount = 0; 33 | SliderControlPropertyCount : array [TPropertyKind] of Integer = (SliderControlPropertyGeneralCount, SliderControlPropertyStyleCount, SliderControlPropertyExtendedCount); 34 | // SliderControlPropertyGeneralName : array [0..SliderControlPropertyGeneralCount - 1] of string = (rstCaption); 35 | SliderControlPropertyStyleName : array [0..SliderControlPropertyStyleCount - 1] of string = (rstVertical, rstPoint, rstTickMarks, rstAutoTicks, rstEnableSelection, rstThumb); 36 | // SliderControlPropertyExtendedName : array [0..SliderControlPropertyExtendedCount - 1] of string = (rstRTLReadingOrder, rstRightAlignedText); 37 | // SliderControlPropertyGeneralType : array [0..SliderControlPropertyGeneralCount - 1] of TPropertyType = (ptString); 38 | SliderControlPropertyStyleType : array [0..SliderControlPropertyStyleCount - 1] of TPropertyType = (ptBoolean, ptEnum, ptBoolean, ptBoolean, ptBoolean, ptBoolean); 39 | // SliderControlPropertyExtendedType : array [0..SliderControlPropertyExtendedCount - 1] of TPropertyType = (ptBoolean, ptBoolean); 40 | 41 | { TSliderControlInfo } 42 | 43 | class procedure TSliderControlInfo.CreateControlParams( 44 | var params: TCreateControlParams); 45 | begin 46 | inherited; 47 | params.ExStyle := params.ExStyle; 48 | end; 49 | 50 | class function TSliderControlInfo.GetDescription: string; 51 | begin 52 | Result := rstSlider 53 | end; 54 | 55 | function TSliderControlInfo.GetPropertyCount( 56 | kind: TPropertyKind): Integer; 57 | begin 58 | Result := inherited GetPropertyCount(kind) + SliderControlPropertyCount [kind] 59 | end; 60 | 61 | function TSliderControlInfo.GetPropertyEnumCount(kind: TPropertyKind; 62 | idx: Integer): Integer; 63 | begin 64 | if idx < inherited GetPropertyCount(kind) then 65 | Result := inherited GetPropertyEnumCount(kind, idx) 66 | else 67 | begin 68 | Dec(idx, inherited GetPropertyCount(kind)); 69 | if idx = 1 then 70 | Result := 3 71 | else 72 | Result := 0; 73 | end 74 | end; 75 | 76 | function TSliderControlInfo.GetPropertyEnumName(kind: TPropertyKind; idx, 77 | enum: Integer): string; 78 | begin 79 | if idx < inherited GetPropertyCount(kind) then 80 | Result := inherited GetPropertyEnumName(kind, idx, enum) 81 | else 82 | begin 83 | Dec(idx, inherited GetPropertyCount(kind)); 84 | if idx = 1 then 85 | case enum of 86 | 0 : Result := rstBoth; 87 | 1 : Result := rstTopLeft; 88 | 2 : Result := rstBottomRight; 89 | else 90 | Result := '' 91 | end 92 | else 93 | Result := '' 94 | end 95 | end; 96 | 97 | function TSliderControlInfo.GetPropertyName(kind: TPropertyKind; 98 | idx: Integer): string; 99 | begin 100 | if idx < inherited GetPropertyCount(kind) then 101 | Result := inherited GetPropertyName(kind, idx) 102 | else 103 | begin 104 | Dec(idx, inherited GetPropertyCount(kind)); 105 | Result := ''; 106 | case kind of 107 | // pkGeneral : Result := StaticControlPropertyGeneralName [idx]; 108 | pkStyle : Result := SliderControlPropertyStyleName [idx]; 109 | // pkExtended : Result := StaticControlPropertyExtendedName [idx]; 110 | end 111 | end 112 | end; 113 | 114 | function TSliderControlInfo.GetPropertyType(kind: TPropertyKind; 115 | idx: Integer): TPropertyType; 116 | begin 117 | if idx < inherited GetPropertyCount(kind) then 118 | Result := inherited GetPropertyType(kind, idx) 119 | else 120 | begin 121 | Dec(idx, inherited GetPropertyCount(kind)); 122 | Result := ptInteger; 123 | case kind of 124 | // pkGeneral : Result := StaticControlPropertyGeneralType [idx]; 125 | pkStyle : Result := SliderControlPropertyStyleType [idx]; 126 | // pkExtended : Result := StaticControlPropertyExtendedType [idx]; 127 | end 128 | end 129 | end; 130 | 131 | function TSliderControlInfo.GetPropertyValue(kind: TPropertyKind; 132 | idx: Integer): Variant; 133 | begin 134 | if idx < inherited GetPropertyCount(kind) then 135 | Result := inherited GetPropertyValue(kind, idx) 136 | else 137 | begin 138 | Dec(idx, inherited GetPropertyCount(kind)); 139 | 140 | case kind of 141 | pkStyle : 142 | case idx of 143 | 0 : Result := HasStyle [TBS_VERT]; 144 | 1 : if HasStyle [TBS_BOTH] then 145 | Result := 0 146 | else 147 | if HasStyle [TBS_LEFT] then 148 | Result := 1 149 | else 150 | Result := 2; 151 | 2 : Result := not HasStyle [TBS_NOTICKS]; 152 | 3 : Result := HasStyle [TBS_AUTOTICKS]; 153 | 4 : Result := HasStyle [TBS_ENABLESELRANGE]; 154 | 5 : Result := not HasStyle [TBS_NOTHUMB]; 155 | end 156 | end 157 | end 158 | end; 159 | 160 | procedure TSliderControlInfo.Init; 161 | begin 162 | inherited; 163 | 164 | SendMessage(ControlHandle, TBM_SETPOS, 66, 0); 165 | end; 166 | 167 | procedure TSliderControlInfo.SetPropertyValue(kind: TPropertyKind; 168 | idx: Integer; const Value: Variant); 169 | var 170 | recreateRequired : Boolean; 171 | begin 172 | if idx < inherited GetPropertyCount(kind) then 173 | inherited SetPropertyValue(kind, idx, Value) 174 | else 175 | begin 176 | Dec(idx, inherited GetPropertyCount(kind)); 177 | recreateRequired := True; 178 | 179 | case kind of 180 | pkStyle : 181 | case idx of 182 | 0 : HasStyle [TBS_VERT] := Value; 183 | 1 : case Integer (Value) of 184 | 0 : SetMaskedStyle(TBS_BOTH, TBS_BOTH or TBS_LEFT); 185 | 1 : SetMaskedStyle(TBS_LEFT, TBS_BOTH or TBS_LEFT); 186 | 2 : SetMaskedStyle(0, TBS_BOTH or TBS_LEFT) 187 | end; 188 | 2 : HasStyle [TBS_NOTICKS] := not Boolean (Value); 189 | 3 : HasStyle [TBS_AUTOTICKS] := Value; 190 | 4 : HasStyle [TBS_ENABLESELRANGE] := Value; 191 | 5 : HasStyle [TBS_NOTHUMB] := not Boolean (Value); 192 | end 193 | end; 194 | 195 | if recreateRequired then 196 | RecreateWnd 197 | end 198 | end; 199 | 200 | end. 201 | -------------------------------------------------------------------------------- /Source/Components/MiscUnitsReg.dcr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/Components/MiscUnitsReg.dcr -------------------------------------------------------------------------------- /Source/Components/ResourceEditorComponentsReg.pas: -------------------------------------------------------------------------------- 1 | unit ResourceEditorComponentsReg; 2 | 3 | interface 4 | 5 | procedure Register; 6 | 7 | {$R MiscUnitsReg.dcr} 8 | 9 | implementation 10 | 11 | uses 12 | Classes, 13 | ComponentBitmapEditor, 14 | ComponentMenuDesigner, 15 | ComponentDialogBox, 16 | ComponentDialogEditor, 17 | ComponentStandardSystemMenu, 18 | ComponentPersistentPosition, 19 | ComponentNTAboutBox, 20 | ComponentHyperlinkButton, 21 | ComponentExSplitter, 22 | ComponentMessageDisplay, 23 | ComponentMRUList, 24 | ComponentPropertyListBox, 25 | ComponentFakeComboBox, 26 | ComponentCWRichEdit, 27 | ComponentRuler, 28 | ComponentHexDump, 29 | ComponentSizingPageControl, 30 | ComponentSpellChecker, 31 | ComponentCWSpellChecker, 32 | ComponentExWebBrowser, 33 | ComponentColorSelector, 34 | ComponentPersistentOptions, 35 | ExVirtualStringTree; 36 | 37 | procedure Register; 38 | begin 39 | RegisterComponents ('Colin Wilson''s Components', [ 40 | TBitmapEditor, 41 | TMenuDesigner, 42 | TPopupMenuDesigner, 43 | TDialogBox, 44 | TDialogEditor, 45 | TStandardSystemMenu, 46 | TPersistentPosition, 47 | TNTAboutBox, 48 | THyperlinkButton, 49 | TExSplitter, 50 | TMessageDisplay, 51 | TMRUList, 52 | TPropertyListBox, 53 | TFakeComboBox, 54 | TExRichEdit, 55 | TRuler, 56 | THexDump, 57 | TSizingPageControl, 58 | TSpellChecker, 59 | TCWSpellChecker, 60 | TExWebBrowser, 61 | TColorSelector, 62 | TRegistryPersistentOptions, 63 | TIniFilePersistentOptions, 64 | TExVirtualStringTree 65 | ]) 66 | end; 67 | 68 | end. 69 | -------------------------------------------------------------------------------- /Source/Components/RichOle.pas: -------------------------------------------------------------------------------- 1 | unit RichOle; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Classes, ActiveX, RichEdit, Clipbrd; 7 | 8 | type 9 | TReObject = record 10 | cbStruct: DWORD; // Size of structure 11 | cp: LongInt; // Character position of object 12 | clsid: TCLSID; // Class ID of object 13 | poleobj: IOleObject; // OLE object interface 14 | pstg: IStorage; // Associated storage interface 15 | polesite: IOleClientSite; // Associated client site interface 16 | sizel: TSize; // Size of object(may be 0,0) 17 | dvaspect: DWORD; // Display aspect to use 18 | dwFlags: DWORD; // Object status flags 19 | dwUser: DWORD; // Dword for user's use 20 | end; 21 | PReObject = ^TReObject; 22 | 23 | // Flags to specify which interfaces should be returned in the structure above 24 | const 25 | REO_GETOBJ_NO_INTERFACES = $00000000; 26 | REO_GETOBJ_POLEOBJ = $00000001; 27 | REO_GETOBJ_PSTG = $00000002; 28 | REO_GETOBJ_POLESITE = $00000004; 29 | REO_GETOBJ_ALL_INTERFACES = $00000007; 30 | 31 | // Place object at selection 32 | REO_CP_SELECTION = -1; 33 | 34 | // Use character position to specify object instead of index 35 | REO_IOB_SELECTION = -1; 36 | REO_IOB_USE_CP = -2; 37 | 38 | // Object flags 39 | REO_NULL = 0; // No flags 40 | REO_READWRITEMASK = $0000003f; // Mask out RO bits 41 | REO_DONTNEEDPALETTE = $00000020; // Object doesn't need palette 42 | REO_BLANK = $00000010; // Object is blank 43 | REO_DYNAMICSIZE = $00000008; // Object defines size always 44 | REO_INVERTEDSELECT = $00000004; // Object drawn all inverted if sel 45 | REO_BELOWBASELINE = $00000002; // Object sits below the baseline 46 | REO_RESIZABLE = $00000001; // Object may be resized 47 | REO_LINK = $80000000; // Object is a link(RO) 48 | REO_STATIC = $40000000; // Object is static (RO) 49 | REO_SELECTED = $08000000; // Object selected (RO) 50 | REO_OPEN = $04000000; // Object open in its server (RO) 51 | REO_INPLACEACTIVE = $02000000; // Object in place active(RO) 52 | REO_HILITED = $01000000; // Object is to be hilited (RO) 53 | REO_LINKAVAILABLE = $00800000; // Link believed available(RO) 54 | REO_GETMETAFILE = $00400000; // Object requires metafile(RO) 55 | 56 | // flags for IRichEditOle.GetClipboardData, 57 | // IRichEditOleCallback.GetClipboardData and 58 | // IRichEditOleCallback.QueryAcceptData 59 | RECO_PASTE = $00000000; // paste from clipboard 60 | RECO_DROP = $00000001; // drop 61 | RECO_COPY = $00000002; // copy to the clipboard 62 | RECO_CUT = $00000003; // cut to the clipboard 63 | RECO_DRAG = $00000004; // drag 64 | 65 | (* 66 | * IRichEditOle 67 | * 68 | * Purpose: 69 | * Interface used by the client of RichEdit to perform OLE-related 70 | * operations. 71 | * 72 | * //$ REVIEW: 73 | * The methods herein may just want to be regular Windows messages. 74 | *) 75 | 76 | type 77 | IRichEditOle = interface(IUnknown) 78 | ['{00020d00-0000-0000-00c0-000000000046}'] 79 | function GetClientSite(out clientSite: IOleClientSite): HResult; stdcall; 80 | function GetObjectCount: Longint; stdcall; 81 | function GetLinkCount: Longint; stdcall; 82 | function GetObject(iob: Longint; var lpreobject: TReObject; dwFlags: DWORD): HRESULT; stdcall; 83 | function InsertObject(const obj: TReObject): HRESULT; stdcall; 84 | function ConvertObject(iob: Longint; const rclsidNew: TCLSID; lpstrUserTypeNew: PChar): HRESULT; stdcall; 85 | function ActivateAs (const clsid: TCLSID; const clsidAs: TCLSID): HRESULT; stdcall; 86 | function SetHostNames (lpstrContainerApp: PChar; lpstrContainerObj: PChar): HRESULT; stdcall; 87 | function SetLinkAvailable(iob: Longint; fAvailable: BOOL): HRESULT; stdcall; 88 | function SetDvaspect(iob: Longint; dvAspect: DWORD): HRESULT; stdcall; 89 | function HandsOffStorage(iob: Longint): HRESULT; stdcall; 90 | function SaveComplete(iob: Longint; lpstg: IStorage): HRESULT; stdcall; 91 | function InPlaceDeactivate: HRESULT; stdcall; 92 | function ContextSensitiveHelp (fEnterMode: BOOL): HRESULT; stdcall; 93 | function GetClipboardData(const lpchrg: TCharRange; reco: DWORD; out lplpDataObj: IDataObject): HRESULT; stdcall; 94 | function ImportDataObject(lpDataObj: IDataObject; cf: TClipFormat; hMetaPict: HGLOBAL): HRESULT; stdcall; 95 | end; 96 | 97 | IRichEditOleCallback = interface(IUnknown) 98 | ['{00020d03-0000-0000-00c0-000000000046}'] 99 | 100 | function GetNewStorage(out lplpstg: IStorage): HRESULT; stdcall; 101 | function GetInPlaceContext(out lplpFrame: IOleInplaceFrame; out lplpDoc: IOleInplaceUIWindow; const lpFrameInfo: TOleInplaceFrameInfo): HRESULT; stdcall; 102 | function ShowContainerUI (fShow: BOOL): HRESULT; stdcall; 103 | function QueryInsertObject(const lpclsid: TCLSID; lpstg: IStorage; cp: Longint): HRESULT; stdcall; 104 | function DeleteObject(lpOleObj: IOleObject): HRESULT; stdcall; 105 | function QueryAcceptData(lpDataObj: IDataObject; var lpcfFormat: TClipFormat; reco: DWORD; fReallity: BOOL; hMetaPict: HGLOBAL): HRESULT; stdcall; 106 | function ContextSensitiveHelp (fEnterMode: BOOL): HRESULT; stdcall; 107 | function GetClipboardData(var lpchrg: TCharRange; reco: DWORD; out lplpDataObj: IDataObject): HRESULT; stdcall; 108 | function GetDragDropEffect(fDrag: BOOL; grfKeyState: DWORD; var pdwEffect: DWORD): HRESULT; stdcall; 109 | function GetContextMenu(selType: Word; lpOleObj: IOleObject; var lpchrg: TCharRange; var lphMenu: HMENU): HRESULT; stdcall; 110 | end; 111 | implementation 112 | 113 | end. 114 | -------------------------------------------------------------------------------- /Source/Components/SpellCheckerForm.dfm: -------------------------------------------------------------------------------- 1 | object fmSpellChecker: TfmSpellChecker 2 | Left = 638 3 | Top = 203 4 | BorderIcons = [biSystemMenu] 5 | BorderStyle = bsSingle 6 | Caption = 'Check Spelling' 7 | ClientHeight = 290 8 | ClientWidth = 440 9 | Color = clBtnFace 10 | Constraints.MinHeight = 257 11 | Constraints.MinWidth = 291 12 | Font.Charset = DEFAULT_CHARSET 13 | Font.Color = clWindowText 14 | Font.Height = -11 15 | Font.Name = 'MS Sans Serif' 16 | Font.Style = [] 17 | FormStyle = fsStayOnTop 18 | OldCreateOrder = True 19 | Position = poMainFormCenter 20 | OnClose = FormClose 21 | OnShow = FormShow 22 | DesignSize = ( 23 | 440 24 | 290) 25 | PixelsPerInch = 96 26 | TextHeight = 13 27 | object LabelUnknownWord: TLabel 28 | Left = 16 29 | Top = 16 30 | Width = 75 31 | Height = 13 32 | Margins.Left = 2 33 | Margins.Top = 2 34 | Margins.Right = 2 35 | Caption = 'Unknown Word' 36 | end 37 | object LabelSuggestions: TLabel 38 | Left = 16 39 | Top = 96 40 | Width = 58 41 | Height = 13 42 | Margins.Left = 2 43 | Margins.Top = 2 44 | Margins.Right = 2 45 | Caption = 'Suggestions' 46 | end 47 | object ButtonChange: TButton 48 | Left = 350 49 | Top = 112 50 | Width = 75 51 | Height = 20 52 | Margins.Left = 2 53 | Margins.Top = 2 54 | Margins.Right = 2 55 | Margins.Bottom = 2 56 | Anchors = [akTop, akRight] 57 | Caption = '&Change' 58 | TabOrder = 0 59 | OnClick = ButtonChangeClick 60 | end 61 | object ButtonChangeAll: TButton 62 | Left = 350 63 | Top = 136 64 | Width = 75 65 | Height = 20 66 | Margins.Left = 2 67 | Margins.Top = 2 68 | Margins.Right = 2 69 | Margins.Bottom = 2 70 | Anchors = [akTop, akRight] 71 | Caption = 'Change A&ll' 72 | TabOrder = 1 73 | OnClick = ButtonChangeAllClick 74 | end 75 | object ButtonSkipAll: TButton 76 | Left = 350 77 | Top = 184 78 | Width = 75 79 | Height = 20 80 | Margins.Left = 2 81 | Margins.Top = 2 82 | Margins.Right = 2 83 | Margins.Bottom = 2 84 | Anchors = [akTop, akRight] 85 | Caption = 'Skip &All' 86 | TabOrder = 2 87 | OnClick = ButtonSkipAllClick 88 | end 89 | object ButtonSkip: TButton 90 | Left = 350 91 | Top = 160 92 | Width = 75 93 | Height = 20 94 | Margins.Left = 2 95 | Margins.Top = 2 96 | Margins.Right = 2 97 | Margins.Bottom = 2 98 | Anchors = [akTop, akRight] 99 | Caption = '&Skip' 100 | TabOrder = 3 101 | OnClick = ButtonSkipClick 102 | end 103 | object ButtonAdd: TButton 104 | Left = 350 105 | Top = 208 106 | Width = 75 107 | Height = 20 108 | Margins.Left = 2 109 | Margins.Top = 2 110 | Margins.Right = 2 111 | Margins.Bottom = 2 112 | Anchors = [akTop, akRight] 113 | Caption = '&Add' 114 | TabOrder = 4 115 | OnClick = ButtonAddClick 116 | end 117 | object ButtonCancel: TButton 118 | Left = 271 119 | Top = 244 120 | Width = 74 121 | Height = 25 122 | Margins.Left = 2 123 | Margins.Top = 2 124 | Margins.Right = 2 125 | Margins.Bottom = 2 126 | Anchors = [akRight, akBottom] 127 | Cancel = True 128 | Caption = 'Cancel' 129 | ModalResult = 2 130 | TabOrder = 5 131 | ExplicitTop = 251 132 | end 133 | object ButtonFinish: TButton 134 | Left = 350 135 | Top = 244 136 | Width = 75 137 | Height = 25 138 | Margins.Left = 2 139 | Margins.Top = 2 140 | Margins.Right = 2 141 | Margins.Bottom = 2 142 | Anchors = [akRight, akBottom] 143 | Caption = 'Finish' 144 | Default = True 145 | ModalResult = 1 146 | TabOrder = 7 147 | ExplicitTop = 251 148 | end 149 | object ListViewSuggestions: TListView 150 | Left = 16 151 | Top = 112 152 | Width = 320 153 | Height = 115 154 | Margins.Left = 2 155 | Margins.Top = 2 156 | Margins.Right = 2 157 | Margins.Bottom = 2 158 | Anchors = [akLeft, akTop, akRight, akBottom] 159 | Columns = < 160 | item 161 | AutoSize = True 162 | Caption = 'Suggestions' 163 | end> 164 | ReadOnly = True 165 | RowSelect = True 166 | ShowColumnHeaders = False 167 | TabOrder = 6 168 | ViewStyle = vsReport 169 | OnDblClick = ListViewSuggestionsDblClick 170 | ExplicitHeight = 122 171 | end 172 | object reText: TExRichEdit 173 | Left = 16 174 | Top = 35 175 | Width = 409 176 | Height = 56 177 | Text = '' 178 | RightMargin = 0 179 | AutoURLDetect = False 180 | AutoURLExecute = False 181 | Font.Charset = ANSI_CHARSET 182 | Font.Color = clWindowText 183 | Font.Height = -11 184 | Font.Name = 'MS Sans Serif' 185 | Font.Style = [] 186 | ParentFont = False 187 | TabOrder = 8 188 | end 189 | object PersistentPosition: TPersistentPosition 190 | Manufacturer = 'Woozle' 191 | Left = 56 192 | Top = 240 193 | end 194 | end 195 | -------------------------------------------------------------------------------- /Source/Components/unitBTree.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/Components/unitBTree.pas -------------------------------------------------------------------------------- /Source/Components/unitDefRegistry.pas: -------------------------------------------------------------------------------- 1 | unit unitDefRegistry; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Classes, SysUtils, Registry; 7 | 8 | type 9 | EDefRegistry = class (Exception) 10 | end; 11 | 12 | TDefRegistry = class (TRegistry) 13 | public 14 | function GetValue(const Name, Default: string): string; overload; 15 | function GetValue(const Name: string; Default: Integer): Integer; overload; 16 | function GetValue(const Name: string; Default: Boolean): Boolean; overload; 17 | procedure GetValue(const Name: string; Strings: TStringList); overload; 18 | 19 | procedure SetValue(const Name, value, Default: string); overload; 20 | procedure SetValue(const Name: string; value, Default: Integer); overload; 21 | procedure SetValue(const Name: string; value, Default: Boolean); overload; 22 | procedure SetValue(const Name: string; Strings: TStringList); overload; 23 | end; 24 | 25 | implementation 26 | 27 | { TDefRegistry } 28 | 29 | (*----------------------------------------------------------------------* 30 | | function TDefRegistry.GetValue | 31 | | | 32 | | Get an Integer value from the registry. Return 'default' if the | 33 | | value does not exist. | 34 | *----------------------------------------------------------------------*) 35 | function TDefRegistry.GetValue(const Name: string; 36 | Default: Integer): Integer; 37 | begin 38 | if ValueExists (Name) then 39 | Result := ReadInteger (Name) 40 | else 41 | Result := Default 42 | end; 43 | 44 | (*----------------------------------------------------------------------* 45 | | function TDefRegistry.GetValue | 46 | | | 47 | | Get a Boolean value from the registry. Return 'default' if the | 48 | | value does not exist. | 49 | *----------------------------------------------------------------------*) 50 | function TDefRegistry.GetValue(const Name: string; 51 | Default: Boolean): Boolean; 52 | begin 53 | if ValueExists (Name) then 54 | Result := ReadBool (Name) 55 | else 56 | Result := Default 57 | end; 58 | 59 | (*----------------------------------------------------------------------* 60 | | function TDefRegistry.GetValue | 61 | | | 62 | | Get a string value from the registry. Return 'default' if the | 63 | | value does not exist. | 64 | *----------------------------------------------------------------------*) 65 | function TDefRegistry.GetValue(const Name, Default: string): string; 66 | begin 67 | if ValueExists (Name) then 68 | Result := ReadString (Name) 69 | else 70 | Result := Default 71 | end; 72 | 73 | procedure TDefRegistry.GetValue(const Name: string; Strings: TStringList); 74 | var 75 | valueType: DWORD; 76 | valueLen: DWORD; 77 | p, buffer: PChar; 78 | begin 79 | Strings.Clear; 80 | if not ValueExists (Name) then Exit; 81 | SetLastError (RegQueryValueEx (CurrentKey, PChar (Name), Nil, @valueType, Nil, @valueLen)); 82 | if GetLastError = ERROR_SUCCESS then 83 | if valueType = REG_MULTI_SZ then 84 | begin 85 | GetMem (buffer, valueLen); 86 | try 87 | RegQueryValueEx (CurrentKey, PChar (Name), Nil, Nil, PBYTE (buffer), @valueLen); 88 | p := buffer; 89 | while p^ <> #0 do 90 | begin 91 | Strings.Add (p); 92 | Inc(p, lstrlen (p) + 1) 93 | end 94 | finally 95 | FreeMem (buffer) 96 | end 97 | end 98 | else 99 | raise ERegistryException.Create('String list expected') 100 | else 101 | raise ERegistryException.Create('Unable read MULTI_SZ value') 102 | end; 103 | 104 | (*----------------------------------------------------------------------* 105 | | function TDefRegistry.SetValue | 106 | | | 107 | | Set a string value in the registry - or delete the value if it | 108 | | matches 'default' | 109 | *----------------------------------------------------------------------*) 110 | procedure TDefRegistry.SetValue(const Name, value, Default: string); 111 | begin 112 | if value = Default then 113 | DeleteValue(Name) 114 | else 115 | WriteString (Name, value) 116 | end; 117 | 118 | (*----------------------------------------------------------------------* 119 | | function TDefRegistry.SetValue | 120 | | | 121 | | Set a Boolean value in the registry - or delete the value if it | 122 | | matches 'default' | 123 | *----------------------------------------------------------------------*) 124 | procedure TDefRegistry.SetValue(const Name: string; value, 125 | Default: Boolean); 126 | begin 127 | if value = Default then 128 | DeleteValue(Name) 129 | else 130 | WriteBool (Name, value) 131 | end; 132 | 133 | (*----------------------------------------------------------------------* 134 | | function TDefRegistry.SetValue | 135 | | | 136 | | Set an Integer value in the registry - or delete the value if it | 137 | | matches 'default' | 138 | *----------------------------------------------------------------------*) 139 | procedure TDefRegistry.SetValue(const Name: string; value, 140 | Default: Integer); 141 | begin 142 | if value = Default then 143 | DeleteValue(Name) 144 | else 145 | WriteInteger (Name, value) 146 | end; 147 | 148 | 149 | procedure TDefRegistry.SetValue(const Name: string; Strings: TStringList); 150 | var 151 | p, buffer: PChar; 152 | i: Integer; 153 | size: DWORD; 154 | begin 155 | if Strings.Count = 0 then 156 | begin 157 | DeleteValue(Name); 158 | exit 159 | end; 160 | size := 0; 161 | for i := 0 to Strings.Count - 1 do 162 | Inc(size, Length(Strings[i]) + 1); 163 | Inc(size); 164 | GetMem (buffer, size); 165 | try 166 | p := buffer; 167 | for i := 0 to Strings.count - 1 do 168 | begin 169 | lstrcpy(p, PChar (Strings[i])); 170 | Inc(p, lstrlen (p) + 1) 171 | end; 172 | p^ := #0; 173 | SetLastError (RegSetValueEx (CurrentKey, PChar (Name), 0, REG_MULTI_SZ, buffer, size)); 174 | if GetLastError <> ERROR_SUCCESS then 175 | raise ERegistryException.Create('Unable to write MULTI_SZ value'); 176 | finally 177 | FreeMem (buffer) 178 | end 179 | end; 180 | 181 | end. 182 | -------------------------------------------------------------------------------- /Source/Components/unitEXGraphics.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/Components/unitEXGraphics.pas -------------------------------------------------------------------------------- /Source/Components/unitExIcon.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/Components/unitExIcon.pas -------------------------------------------------------------------------------- /Source/Components/unitExRegistry.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/Components/unitExRegistry.pas -------------------------------------------------------------------------------- /Source/Components/unitHTMLHelpViewer.pas: -------------------------------------------------------------------------------- 1 | unit unitHTMLHelpViewer; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Classes, SysUtils; 7 | 8 | function HHPreTranslateMessage(var Msg: TMsg): Boolean; 9 | procedure InitializeHTMLHelp; 10 | 11 | implementation 12 | 13 | uses 14 | HelpIntfs, unitHTMLHelp, Forms; 15 | 16 | type 17 | TWHCommandType = (twhContext, twhCommand, twhContents, twhQuit); 18 | 19 | THTMLHelpViewer = class(TInterfacedObject, ICustomHelpViewer, IExtendedHelpViewer, IHelpSelector) 20 | private 21 | FViewerID: Integer; 22 | FLastCommandType: TWHCommandType; 23 | public 24 | FHelpManager: IHelpManager; 25 | procedure InternalShutDown; 26 | 27 | { ICustomHelpViewer } 28 | function GetViewerName: String; 29 | function UnderstandsKeyword(const HelpString: String): Integer; 30 | function GetHelpStrings(const HelpString: String): TStringList; 31 | function CanShowTableOfContents: Boolean; 32 | procedure ShowTableOfContents; 33 | procedure ShowHelp(const HelpString: String); 34 | procedure NotifyID(const ViewerID: Integer); 35 | procedure SoftShutDown; 36 | procedure ShutDown; 37 | 38 | { IExtendedHelpViewer } 39 | function UnderstandsTopic(const Topic: String): Boolean; 40 | procedure DisplayTopic(const Topic: String); 41 | function UnderstandsContext(const ContextID: THelpContext; 42 | const HelpFileName: String): Boolean; 43 | procedure DisplayHelpByContext(const ContextID: THelpContext; 44 | const HelpFileName: String); 45 | 46 | 47 | property HelpManager: IHelpManager read FHelpManager write FHelpManager; 48 | property ViewerID: Integer read FViewerID; 49 | 50 | { IHelpSelector} 51 | function SelectKeyword(Keywords: TStrings): Integer; 52 | function TableOfContents(Contents: TStrings): Integer; 53 | end; 54 | 55 | var 56 | HTMLHelpViewer: THTMLHelpViewer; 57 | HelpSystem: IHelpSystem; 58 | dwHHCookie: DWORD; 59 | gInitialized: Boolean = False; 60 | 61 | resourcestring 62 | rstHTMLHelp = 'HTML Help'; 63 | 64 | { THTMLHelpViewer } 65 | 66 | function HHPreTranslateMessage(var Msg: TMsg): Boolean; 67 | begin 68 | Result := HtmlHelp (0, Nil, HH_PRETRANSLATEMESSAGE, DWORD (@Msg)) = 0 69 | end; 70 | 71 | procedure InitializeHTMLHelp; 72 | begin 73 | if not gInitialized then 74 | begin 75 | HtmlHelp (0, nil, HH_INITIALIZE, DWORD (@dwHHCookie)); 76 | HTMLHelpViewer := THTMLHelpViewer.Create; 77 | HelpIntfs.RegisterViewer(HTMLHelpViewer, HTMLHelpViewer.FHelpManager); 78 | GetHelpSystem (helpSystem); 79 | helpSystem.AssignHelpSelector(HTMLHelpViewer); 80 | gInitialized := True 81 | end 82 | end; 83 | 84 | function THTMLHelpViewer.CanShowTableOfContents: Boolean; 85 | begin 86 | Result := True; 87 | end; 88 | 89 | procedure THTMLHelpViewer.DisplayHelpByContext(const ContextID: THelpContext; 90 | const HelpFileName: String); 91 | begin 92 | // stub 93 | end; 94 | 95 | procedure THTMLHelpViewer.DisplayTopic(const Topic: String); 96 | begin 97 | // stub 98 | end; 99 | 100 | function THTMLHelpViewer.GetHelpStrings( 101 | const HelpString: String): TStringList; 102 | begin 103 | Result := TStringList.Create; 104 | Result.Add(GetViewerName + ': ' + HelpString) 105 | end; 106 | 107 | function THTMLHelpViewer.GetViewerName: String; 108 | begin 109 | Result := rstHTMLHelp; 110 | end; 111 | 112 | procedure THTMLHelpViewer.InternalShutDown; 113 | begin 114 | SoftShutDown; 115 | if Assigned(FHelpManager) then 116 | begin 117 | HelpManager.Release(ViewerID); 118 | if Assigned(FHelpManager) then HelpManager := nil; 119 | end; 120 | end; 121 | 122 | procedure THTMLHelpViewer.NotifyID(const ViewerID: Integer); 123 | begin 124 | FViewerID := ViewerID; 125 | end; 126 | 127 | function THTMLHelpViewer.SelectKeyword(Keywords: TStrings): Integer; 128 | var 129 | p: Integer; 130 | st: string; 131 | begin 132 | Result := 0; 133 | while Result < keywords.Count do 134 | begin 135 | st := keywords[Result]; 136 | p := Pos (':', st); 137 | if p >= 0 then 138 | st := Copy(st, 1, p - 1); 139 | 140 | if st = rstHTMLHelp then 141 | Exit 142 | else 143 | Inc(Result); 144 | end; 145 | Result := -1 146 | end; 147 | 148 | procedure THTMLHelpViewer.ShowHelp(const HelpString: String); 149 | begin 150 | 151 | end; 152 | 153 | procedure THTMLHelpViewer.ShowTableOfContents; 154 | var 155 | fn, pn: string; 156 | begin 157 | fn := FHelpManager.GetHelpFile; 158 | pn := ExtractFilePath(ParamStr (0)); 159 | fn := pn + fn; 160 | HTMLHelp (Application.Handle, PChar (fn), HH_DISPLAY_TOC, 0); 161 | end; 162 | 163 | procedure THTMLHelpViewer.ShutDown; 164 | begin 165 | SoftShutDown; 166 | if Assigned(FHelpManager) then HelpManager := nil; 167 | end; 168 | 169 | procedure THTMLHelpViewer.SoftShutDown; 170 | begin 171 | FLastCommandType := twhQuit; 172 | HTMLHelp(0, nil, HH_CLOSE_ALL, 0); 173 | end; 174 | 175 | function THTMLHelpViewer.TableOfContents(Contents: TStrings): Integer; 176 | begin 177 | Result := 0; 178 | while Result < contents.Count do 179 | if contents[result] = rstHTMLHelp then 180 | exit 181 | else 182 | Inc(Result); 183 | Result := -1; 184 | end; 185 | 186 | function THTMLHelpViewer.UnderstandsContext(const ContextID: THelpContext; 187 | const HelpFileName: String): Boolean; 188 | begin 189 | Result := False; 190 | end; 191 | 192 | function THTMLHelpViewer.UnderstandsKeyword( 193 | const HelpString: String): Integer; 194 | var 195 | params: THHAKlink; 196 | fn, pn: string; 197 | begin 198 | fn := FHelpManager.GetHelpFile; 199 | pn := ExtractFilePath(ParamStr (0)); 200 | fn := pn + fn; 201 | HTMLHelp (Application.Handle, PChar (fn), HH_DISPLAY_TOPIC, 0); 202 | 203 | params.cbStruct := SizeOf(params); 204 | params.pszKeywords := PChar (HelpString); 205 | params.pszUrl := nil; 206 | params.pszMsgText := nil; 207 | params.pszMsgTitle := nil; 208 | params.pszWindow := nil; 209 | params.fReserved := False; 210 | 211 | HTMLHelp (Application.Handle, PChar (fn), HH_ALINK_LOOKUP, DWORD (@params)); 212 | Result := 1; 213 | end; 214 | 215 | function THTMLHelpViewer.UnderstandsTopic(const Topic: String): Boolean; 216 | begin 217 | Result := False; 218 | end; 219 | 220 | initialization 221 | 222 | finalization 223 | if gInitialized then 224 | begin 225 | if Assigned(HTMLHelpViewer.FHelpManager) then 226 | begin 227 | HTMLHelpViewer.InternalShutDown; 228 | end; 229 | 230 | HtmlHelp (0, Nil, HH_UNINITIALIZE, dwHHCookie); // Access violation! 231 | end 232 | end. 233 | -------------------------------------------------------------------------------- /Source/Components/unitNTModule.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/Components/unitNTModule.pas -------------------------------------------------------------------------------- /Source/Components/unitObjectCache.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/Components/unitObjectCache.pas -------------------------------------------------------------------------------- /Source/Components/unitRCFile.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/Components/unitRCFile.pas -------------------------------------------------------------------------------- /Source/Components/unitResourceAccelerator.pas: -------------------------------------------------------------------------------- 1 | unit unitResourceAccelerator; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Classes, SysUtils, Contnrs, Menus, unitResourceDetails; 7 | 8 | type 9 | TAccelerator = packed record 10 | flags: word; 11 | code: word; 12 | id: word; 13 | padding: word; 14 | end; 15 | PAccelerator = ^TAccelerator; 16 | 17 | TAcceleratorResourceDetails = class (TResourceDetails) 18 | private 19 | FCount: Integer; 20 | function GetCount: Integer; 21 | function GetAccelerator(idx: Integer): TAccelerator; 22 | function GetAccelPointer (idx: Integer): PAccelerator; 23 | public 24 | constructor Create(AParent: TResourceModule; ALanguage: Integer; const AName, AType: WideString; ASize: Integer; AData: pointer); override; 25 | class function GetBaseType: WideString; override; 26 | 27 | procedure InitNew; override; 28 | function Add (flags, code, id: Integer): Integer; 29 | procedure Delete(idx: Integer); 30 | procedure SetAccelDetails (idx: Integer; flags, code, id: Integer); 31 | 32 | property Count: Integer read GetCount; 33 | property Accelerator [idx: Integer]: TAccelerator read GetAccelerator; 34 | end; 35 | 36 | implementation 37 | 38 | { TAcceleratorResourceDetails } 39 | 40 | function TAcceleratorResourceDetails.Add(flags, code, id: Integer): Integer; 41 | var 42 | ct: Integer; 43 | p: PAccelerator; 44 | begin 45 | ct := Count; 46 | Data.Size := Data.Size + SizeOf(TAccelerator); 47 | Inc(FCount); 48 | p := GetAccelPointer (ct); 49 | p^.flags := flags or $80; 50 | p^.code := code; 51 | p^.id := id; 52 | p^.padding := 0; 53 | 54 | if Count > 1 then 55 | begin 56 | p := GetAccelPointer (Count - 2); 57 | p^.flags := p^.flags and not $80 58 | end; 59 | Result := ct; 60 | end; 61 | 62 | constructor TAcceleratorResourceDetails.Create(AParent: TResourceModule; 63 | ALanguage: Integer; const AName, AType: WideString; ASize: Integer; 64 | AData: pointer); 65 | begin 66 | inherited Create(AParent, ALanguage, AName, AType, ASize, AData); 67 | 68 | FCount := -1; 69 | end; 70 | 71 | procedure TAcceleratorResourceDetails.Delete(idx: Integer); 72 | var 73 | p, p1: PAccelerator; 74 | begin 75 | if idx >= Count then Exit; 76 | 77 | if idx < Count - 1 then 78 | begin 79 | p := GetAccelPointer (idx); 80 | p1 := GetAccelPointer (idx + 1); 81 | Move(p1^, p^, SizeOf(TAccelerator) * (Count - idx - 1)); 82 | end; 83 | 84 | Dec(FCount); 85 | Data.Size := Data.Size - SizeOf(TAccelerator); 86 | 87 | if Count > 0 then 88 | begin 89 | p := GetAccelPointer (Count - 1); 90 | p^.flags := p^.flags or $80 91 | end 92 | end; 93 | 94 | function TAcceleratorResourceDetails.GetAccelerator( 95 | idx: Integer): TAccelerator; 96 | begin 97 | Result := GetAccelPointer (idx)^ 98 | end; 99 | 100 | function TAcceleratorResourceDetails.GetAccelPointer( 101 | idx: Integer): PAccelerator; 102 | begin 103 | if idx < Count then 104 | begin 105 | Result := PAccelerator (Data.Memory); 106 | Inc(Result, idx) 107 | end 108 | else 109 | raise ERangeError.Create('Index out of bounds'); 110 | end; 111 | 112 | class function TAcceleratorResourceDetails.GetBaseType: WideString; 113 | begin 114 | Result := IntToStr (Integer (RT_ACCELERATOR)); 115 | end; 116 | 117 | function TAcceleratorResourceDetails.GetCount: Integer; 118 | var 119 | p: PAccelerator; 120 | sz: Integer; 121 | begin 122 | if FCount = -1 then 123 | begin 124 | p := PAccelerator (Data.Memory); 125 | FCount := 0; 126 | sz := 0; 127 | while sz + SizeOf(TAccelerator) <= Data.Size do 128 | begin 129 | Inc(FCount); 130 | if (p^.flags and $80) <> 0 then 131 | Break; 132 | Inc(p); 133 | Inc(sz, SizeOf(TAccelerator)) 134 | end 135 | end; 136 | Result := FCount; 137 | end; 138 | 139 | procedure TAcceleratorResourceDetails.InitNew; 140 | begin 141 | inherited; 142 | end; 143 | 144 | 145 | procedure TAcceleratorResourceDetails.SetAccelDetails(idx, flags, code, 146 | id: Integer); 147 | var 148 | p: PAccelerator; 149 | begin 150 | p := GetAccelPointer (idx); 151 | if p <> Nil then 152 | begin 153 | if idx = Count - 1 then 154 | flags := flags or $80; 155 | p^.flags := flags; 156 | p^.id := id; 157 | p^.code := code 158 | end 159 | end; 160 | 161 | initialization 162 | RegisterResourceDetails(TAcceleratorResourceDetails); 163 | finalization 164 | UnregisterResourceDetails(TAcceleratorResourceDetails); 165 | end. 166 | -------------------------------------------------------------------------------- /Source/Components/unitResourceDialogs.pas: -------------------------------------------------------------------------------- 1 | unit unitResourceDialogs; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Classes, SysUtils, unitResourceDetails, DialogConsts; 7 | 8 | type 9 | TDialogResourceDetails = class (TResourceDetails) 10 | public 11 | class function GetBaseType: WideString; override; 12 | procedure InitNew; override; 13 | 14 | procedure BeginInit(x, y, cx, cy: Integer; Style, ExStyle: DWORD; menu, cls, title: TSzOrID; fontSize: DWORD; const faceName: string); 15 | procedure BeginInitEx (x, y, cx, cy: Integer; Style, ExStyle, helpID: DWORD; menu, cls, title: TSzOrID; fontSize, fontWeight, fontItalic, fontCharset: DWORD; const faceName: string); 16 | procedure InitAddControl (cls: TSzOrID; id: DWORD; const text: TSzOrID; x, y, cx, cy: Integer; Style, ExStyle: DWORD; dataLen: DWORD; const dat); 17 | procedure InitAddControlEx (cls: TSzOrID; id: DWORD; const text: TSzOrID; x, y, cx, cy: Integer; Style, ExStyle, helpId: DWORD; dataLen: DWORD; const dat); 18 | procedure EndInit(ctrlCount: DWORD); 19 | procedure EndInitEx (ctrlCount: DWORD); 20 | end; 21 | 22 | implementation 23 | 24 | { TDialogResourceDetails } 25 | 26 | procedure TDialogResourceDetails.BeginInit(x, y, cx, cy: Integer; Style, 27 | ExStyle: DWORD; menu, cls, title: TSzOrID; fontSize: DWORD; const faceName: string); 28 | var 29 | template: TDlgTemplate; 30 | w: word; 31 | wFace: WideString; 32 | begin 33 | Data.Clear; 34 | if faceName <> '' then 35 | Style := Style or DS_SETFONT; 36 | template.style := Style; 37 | template.dwExtendedStyle := exstyle; 38 | template.x := x; 39 | template.y := y; 40 | template.cx := cx; 41 | template.cy := cy; 42 | template.cdit :=0; 43 | 44 | data.Write(template, SizeOf(template)); 45 | 46 | WriteSzOrID (data, menu); 47 | WriteSzOrID (data, cls); 48 | WriteSzOrID (data, title); 49 | 50 | w := fontSize; 51 | data.Write(w, SizeOf(w)); 52 | 53 | wFace := faceName; 54 | data.Write(PWideChar (wFace)^, (Length(wFace) + 1) * SizeOf(WideChar)) 55 | end; 56 | 57 | procedure TDialogResourceDetails.BeginInitEx(x, y, cx, cy: Integer; Style, 58 | ExStyle, helpId: DWORD; menu, cls, title: TSzOrID; fontSize, fontWeight, fontItalic, fontCharset: DWORD; 59 | const faceName: string); 60 | var 61 | template: TDlgTemplateEx; 62 | w: word; 63 | wFace: WideString; 64 | b: byte; 65 | begin 66 | Data.Clear; 67 | if faceName <> '' then 68 | Style := Style or DS_SETFONT; 69 | template.dlgVer := 1; 70 | template.style := Style; 71 | template.exStyle := exstyle; 72 | template.x := x; 73 | template.y := y; 74 | template.cx := cx; 75 | template.cy := cy; 76 | template.cDlgItems :=0; 77 | template.signature := $ffff; 78 | template.helpID := helpId; 79 | 80 | data.Write(template, SizeOf(template)); 81 | 82 | WriteSzOrID (data, menu); 83 | WriteSzOrID (data, cls); 84 | WriteSzOrID (data, title); 85 | 86 | w := fontSize; 87 | data.Write(w, SizeOf(w)); 88 | 89 | w := fontWeight; 90 | data.Write(w, SizeOf(w)); 91 | 92 | b := fontItalic; 93 | data.Write(b, SizeOf(b)); 94 | 95 | b := fontCharset; 96 | data.Write(b, SizeOf(b)); 97 | 98 | wFace := faceName; 99 | data.Write(PWideChar (wFace)^, (Length(wFace) + 1) * SizeOf(WideChar)) 100 | end; 101 | 102 | procedure TDialogResourceDetails.EndInit(ctrlCount: DWORD); 103 | var 104 | p: PDlgTemplate; 105 | begin 106 | p := PDlgTemplate(Data.Memory); 107 | p^.cdit := CtrlCount 108 | end; 109 | 110 | procedure TDialogResourceDetails.EndInitEx(ctrlCount: DWORD); 111 | var 112 | p: PDlgTemplateEx; 113 | begin 114 | p := PDlgTemplateEx (Data.Memory); 115 | p^.cDlgItems := CtrlCount 116 | end; 117 | 118 | class function TDialogResourceDetails.GetBaseType: WideString; 119 | begin 120 | Result := IntToStr (Integer (RT_DIALOG)); 121 | end; 122 | 123 | procedure TDialogResourceDetails.InitAddControl(cls: TSzOrID; id: DWORD; 124 | const text: TSzOrID; x, y, cx, cy: Integer; Style, ExStyle: DWORD; dataLen: DWORD; const dat); 125 | var 126 | templ: TDlgItemTemplate; 127 | w: word; 128 | begin 129 | Pad (data); 130 | 131 | templ.style := Style; 132 | templ.dwExtendedStyle := ExStyle; 133 | templ.x := x; 134 | templ.y := y; 135 | templ.cx := cx; 136 | templ.cy := cy; 137 | templ.id := id; 138 | 139 | data.Write(templ, SizeOf(templ)); 140 | 141 | // Pad (Data); 142 | 143 | WriteSZOrID (Data, cls); 144 | 145 | WriteSZOrID (Data, text); 146 | 147 | w := dataLen; 148 | Data.Write(w, SizeOf(w)); 149 | 150 | if w > 0 then 151 | Data.Write(dat, w) 152 | end; 153 | 154 | procedure TDialogResourceDetails.InitAddControlEx(cls: TSzOrID; id: DWORD; 155 | const text: TSzOrID; x, y, cx, cy: Integer; Style, ExStyle, helpId, 156 | dataLen: DWORD; const dat); 157 | var 158 | templ: TDlgItemTemplateEx; 159 | w: word; 160 | begin 161 | Pad (data); 162 | 163 | templ.style := Style; 164 | templ.exStyle := ExStyle; 165 | templ.x := x; 166 | templ.y := y; 167 | templ.cx := cx; 168 | templ.cy := cy; 169 | templ.id := id; 170 | templ.helpID := 0; 171 | 172 | data.Write(templ, SizeOf(templ)); 173 | 174 | Pad (Data); 175 | 176 | WriteSZOrID (Data, cls); 177 | 178 | WriteSZOrID (Data, text); 179 | 180 | w := dataLen; 181 | Data.Write(w, SizeOf(w)); 182 | 183 | if w > 0 then 184 | Data.Write(dat, w) 185 | end; 186 | 187 | procedure TDialogResourceDetails.InitNew; 188 | var 189 | id: TszOrID; 190 | begin 191 | // Defaults from VC6 192 | 193 | id.isID := False; 194 | id.sz := ''; 195 | 196 | BeginInit(0, 0, 186, 95, DS_MODALFRAME or WS_POPUP or WS_CAPTION or WS_SYSMENU or DS_SETFONT or WS_VISIBLE, 0, id, id, id, 8, 'MS Shell Dlg'); 197 | EndInit(0); 198 | end; 199 | 200 | initialization 201 | RegisterResourceDetails(TDialogResourceDetails); 202 | finalization 203 | UnregisterResourceDetails(TDialogResourceDetails); 204 | end. 205 | -------------------------------------------------------------------------------- /Source/Components/unitResourceExaminer.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/Components/unitResourceExaminer.pas -------------------------------------------------------------------------------- /Source/Components/unitResourceGIF.pas: -------------------------------------------------------------------------------- 1 | unit unitResourceGIF; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Classes, SysUtils, Graphics, GIFImage, unitResourceDetails, 7 | unitResourceGraphics; 8 | 9 | type 10 | //------------------------------------------------------------------------ 11 | // GIF resource details class 12 | 13 | TGifResourceDetails = class (TGraphicsResourceDetails) 14 | protected 15 | function GetHeight: Integer; override; 16 | function GetPixelFormat: TPixelFormat; override; 17 | function GetWidth: Integer; override; 18 | procedure InitNew; override; 19 | class function SupportsData(Size : Integer; data : Pointer) : Boolean; override; 20 | public 21 | class function GetBaseType : WideString; override; 22 | procedure GetImage(picture : TPicture); override; 23 | end; 24 | 25 | 26 | implementation 27 | 28 | { TGifResourceDetails } 29 | 30 | class function TGifResourceDetails.GetBaseType: WideString; 31 | begin 32 | Result := 'GIF'; 33 | end; 34 | 35 | function TGifResourceDetails.GetHeight: Integer; 36 | begin 37 | Result := PWORD (PChar (data) + 6 + SizeOf(Word))^; 38 | end; 39 | 40 | procedure TGifResourceDetails.GetImage(picture: TPicture); 41 | var 42 | gif : TGIFImage; 43 | begin 44 | gif := TGifImage.Create; 45 | picture.graphic := gif; 46 | data.Seek(0, soFromBeginning); 47 | TGifImage(picture.graphic).LoadFromStream (data); 48 | end; 49 | 50 | function TGifResourceDetails.GetPixelFormat: TPixelFormat; 51 | begin 52 | Result := pf8Bit; 53 | end; 54 | 55 | function TGifResourceDetails.GetWidth: Integer; 56 | begin 57 | Result := PWORD (PChar (data) + 6)^; 58 | end; 59 | 60 | procedure TGifResourceDetails.InitNew; 61 | var 62 | img : TGIFImage; 63 | bmp : TBitmap; 64 | begin 65 | bmp := nil; 66 | img := TGIFImage.Create; 67 | try 68 | bmp := TBitmap.Create; 69 | bmp.Width := 64; 70 | bmp.Height := 64; 71 | img.Assign(bmp); 72 | img.Transparent := True; 73 | img.SaveToStream (data); 74 | finally 75 | img.Free; 76 | bmp.Free 77 | end 78 | end; 79 | 80 | class function TGifResourceDetails.SupportsData(Size: Integer; 81 | data: Pointer): Boolean; 82 | var 83 | p : PChar; 84 | begin 85 | p := PChar (data); 86 | 87 | Result := (StrLIComp (p, 'GIF87', 5) = 0) or (StrLIComp (p, 'GIF89', 5) = 0); 88 | end; 89 | 90 | initialization 91 | RegisterResourceDetails (TGIFResourceDetails); 92 | finalization 93 | UnregisterResourceDetails (TGIFResourceDetails); 94 | end. 95 | -------------------------------------------------------------------------------- /Source/Components/unitResourceHTML.pas: -------------------------------------------------------------------------------- 1 | unit unitResourceHTML; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Classes, SysUtils, unitResourceDetails; 7 | 8 | const 9 | RT_HTML = MakeIntResource(23); 10 | 11 | type 12 | //------------------------------------------------------------------------ 13 | // HTML resource details class 14 | 15 | THTMLResourceDetails = class(TAnsiResourceDetails) 16 | protected 17 | procedure InitNew; override; 18 | class function SupportsData(Size: Integer; data: Pointer): Boolean; override; 19 | public 20 | class function GetBaseType: WideString; override; 21 | end; 22 | 23 | 24 | implementation 25 | 26 | { THTMLResourceDetails } 27 | 28 | class function THTMLResourceDetails.GetBaseType: WideString; 29 | begin 30 | Result := IntToStr (Integer (RT_HTML)) 31 | end; 32 | 33 | procedure THTMLResourceDetails.InitNew; 34 | begin 35 | Text := ''#13#10''; 36 | end; 37 | 38 | class function THTMLResourceDetails.SupportsData(Size: Integer; 39 | data: Pointer): Boolean; 40 | var 41 | p: PChar; 42 | begin 43 | p := PChar (data); 44 | Result := (StrLIComp (p, ' #$ff then 52 | raise Exception.Create('Invalid JPEG Image'); 53 | 54 | Inc(p); 55 | 56 | seg := Byte(p^); 57 | 58 | if seg <> $ff then 59 | begin 60 | Inc(p); 61 | 62 | if seg = segment then 63 | begin 64 | Result := True; 65 | data := p; 66 | break 67 | end; 68 | 69 | if seg = $d9 then // end of image 70 | break; 71 | 72 | if Pos (char (seg), ParameterlessSegments) = 0 then 73 | begin 74 | len := 256 * Byte(p^) + Byte((p + 1)^); 75 | Inc(p, len) 76 | end 77 | end 78 | until False 79 | end; 80 | 81 | procedure GetJPegSize(data: PChar; var Width, Height: Integer); 82 | var 83 | len: Integer; 84 | begin 85 | if FindJPegSegment(data, $c0) then 86 | begin 87 | len := 256 * Byte(data^) + Byte((data + 1)^); 88 | 89 | if len > 5 then 90 | begin 91 | Inc(data, 3); // Skip len word & precision byte 92 | Height := 256 * Byte(data^) + Byte((data + 1)^); 93 | 94 | Inc(data, 2); 95 | Width := 256 * Byte(data^) + Byte((data + 1)^); 96 | end 97 | end 98 | end; 99 | 100 | { TJPegResourceDetails } 101 | 102 | class function TJPegResourceDetails.GetBaseType: WideString; 103 | begin 104 | Result := 'JPEG' 105 | end; 106 | 107 | function TJPegResourceDetails.GetHeight: Integer; 108 | begin 109 | if FHeight = 0 then 110 | GetJPegSize(data.Memory, FWidth, FHeight); 111 | 112 | Result := FHeight; 113 | end; 114 | 115 | procedure TJPegResourceDetails.GetImage(picture: TPicture); 116 | begin 117 | picture.graphic := TJPegImage.Create; 118 | data.Seek(0, soFromBeginning); 119 | TJpegImage(picture.graphic).LoadFromStream (data); 120 | FWidth := picture.graphic.Width; 121 | FHeight := picture.graphic.Height; 122 | end; 123 | 124 | function TJPegResourceDetails.GetPixelFormat: TPixelFormat; 125 | begin 126 | Result := pf24Bit; 127 | end; 128 | 129 | function TJPegResourceDetails.GetWidth: Integer; 130 | begin 131 | if FWidth = 0 then 132 | GetJPegSize(data.Memory, FWidth, FHeight); 133 | Result := FWidth; 134 | end; 135 | 136 | procedure TJPegResourceDetails.InitNew; 137 | var 138 | img: TJPegImage; 139 | bmp: TBitmap; 140 | begin 141 | bmp := nil; 142 | img := TJPegImage.Create; 143 | try 144 | bmp := TBitmap.Create; 145 | bmp.Width := 64; 146 | bmp.Height := 64; 147 | img.Assign(bmp); 148 | img.SaveToStream (data); 149 | finally 150 | img.Free; 151 | bmp.Free 152 | end 153 | end; 154 | 155 | procedure TJPegResourceDetails.SetImage(image: TPicture); 156 | begin 157 | inherited; 158 | FWidth := image.Width; 159 | FHeight := image.Height; 160 | end; 161 | 162 | class function TJPegResourceDetails.SupportsData(Size: Integer; 163 | data: Pointer): Boolean; 164 | var 165 | len: Integer; 166 | begin 167 | Result := False; 168 | if PWORD (data)^ = $d8ff then 169 | if FindJPegSegment(PChar (data), $e0) then 170 | begin 171 | len := 256 * Byte(PChar (data)^) + Byte((PChar (data) + 1)^); 172 | 173 | if len >= 16 then 174 | begin 175 | Inc(PChar (data), 2); 176 | 177 | if StrLIComp (data, 'JFIF', 4) = 0 then 178 | Result := True 179 | end 180 | end 181 | end; 182 | 183 | initialization 184 | RegisterResourceDetails(TJPEGResourceDetails); 185 | finalization 186 | UnRegisterResourceDetails(TJPEGResourceDetails); 187 | end. 188 | -------------------------------------------------------------------------------- /Source/Components/unitResourcePNG.pas: -------------------------------------------------------------------------------- 1 | unit unitResourcePNG; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Classes, SysUtils, Graphics, PngImage, unitResourceDetails, 7 | unitResourceGraphics; 8 | 9 | type 10 | //------------------------------------------------------------------------ 11 | // PNG resource details class 12 | 13 | TPngResourceDetails = class (TGraphicsResourceDetails) 14 | protected 15 | function GetHeight: Integer; override; 16 | function GetPixelFormat: TPixelFormat; override; 17 | function GetWidth: Integer; override; 18 | class function SupportsData(Size: Integer; data: Pointer): Boolean; override; 19 | public 20 | class function GetBaseType: WideString; override; 21 | procedure GetImage(Picture: TPicture); override; 22 | end; 23 | 24 | 25 | implementation 26 | 27 | { TPngResourceDetails } 28 | 29 | class function TPngResourceDetails.GetBaseType: WideString; 30 | begin 31 | Result := 'PNG'; 32 | end; 33 | 34 | function TPngResourceDetails.GetHeight: Integer; 35 | begin 36 | Result := PWORD(PChar(data) + 6 + SizeOf(Word))^; 37 | end; 38 | 39 | procedure TPngResourceDetails.GetImage(Picture: TPicture); 40 | begin 41 | Picture.graphic := TPngImage.Create; 42 | Data.Seek(0, soFromBeginning); 43 | TPngImage(picture.graphic).LoadFromStream(data) 44 | end; 45 | 46 | function TPngResourceDetails.GetPixelFormat: TPixelFormat; 47 | begin 48 | Result := pf8Bit; 49 | end; 50 | 51 | function TPngResourceDetails.GetWidth: Integer; 52 | begin 53 | Result := PWORD (PChar (data) + 6)^; 54 | end; 55 | 56 | class function TPngResourceDetails.SupportsData(Size: Integer; 57 | data: Pointer): Boolean; 58 | var 59 | p: PChar; 60 | begin 61 | p := PChar (data); 62 | Inc(p); 63 | 64 | Result := (StrLIComp (p, 'PNG', 3) = 0); 65 | end; 66 | 67 | initialization 68 | RegisterResourceDetails(TPngResourceDetails); 69 | finalization 70 | UnregisterResourceDetails(TPngResourceDetails); 71 | end. 72 | 73 | 74 | -------------------------------------------------------------------------------- /Source/Components/unitResourceToolbar.pas: -------------------------------------------------------------------------------- 1 | unit unitResourceToolbar; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Classes, SysUtils, Contnrs, Menus, unitResourceDetails; 7 | 8 | const 9 | RT_TOOLBAR = MakeIntResource(241); 10 | 11 | type 12 | TToolbarResourceDetails = class (TResourceDetails) 13 | protected 14 | constructor Create(AParent: TResourceModule; ALanguage: Integer; const AName, AType: WideString; ASize: Integer; AData: pointer); override; 15 | 16 | public 17 | destructor Destroy; override; 18 | 19 | class function GetBaseType: WideString; override; 20 | procedure ChangeData(newData: TMemoryStream); override; 21 | 22 | procedure InitNew; override; 23 | end; 24 | 25 | implementation 26 | 27 | type 28 | TToolbarData = packed record // From a CodeGuru message quoting MFC source... 29 | wVersion: word; 30 | wBtnWidth: word; 31 | wBtnHeight: word; 32 | wBtnCount: word; 33 | wButtonIDs: array [0..0] of word; 34 | end; 35 | 36 | { TToolbarResourceDetails } 37 | 38 | procedure TToolbarResourceDetails.ChangeData(newData: TMemoryStream); 39 | begin 40 | inherited; 41 | end; 42 | 43 | constructor TToolbarResourceDetails.Create(AParent: TResourceModule; 44 | ALanguage: Integer; const AName, AType: WideString; ASize: Integer; 45 | AData: pointer); 46 | begin 47 | inherited Create(AParent, ALanguage, AName, AType, ASize, AData); 48 | end; 49 | 50 | destructor TToolbarResourceDetails.Destroy; 51 | begin 52 | inherited; 53 | end; 54 | 55 | class function TToolbarResourceDetails.GetBaseType: WideString; 56 | begin 57 | Result := IntToStr (Integer (RT_TOOLBAR)); 58 | end; 59 | 60 | procedure TToolbarResourceDetails.InitNew; 61 | var 62 | dat: TToolbarData; 63 | begin 64 | dat.wVersion := 1; 65 | dat.wBtnWidth := 16; 66 | dat.wBtnHeight := 15; 67 | dat.wBtnCount := 0; 68 | 69 | data.Write(dat, SizeOf(dat) - SizeOf(dat.wButtonIDs)) 70 | end; 71 | 72 | initialization 73 | RegisterResourceDetails(TToolbarResourceDetails); 74 | finalization 75 | UnregisterResourceDetails(TToolbarResourceDetails); 76 | end. 77 | -------------------------------------------------------------------------------- /Source/Components/unitResourceXPManifests.pas: -------------------------------------------------------------------------------- 1 | unit unitResourceXPManifests; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Classes, SysUtils, Contnrs, AxCtrls, unitResourceDetails; 7 | 8 | type 9 | TXPManifestResourceDetails = class (TAnsiResourceDetails) 10 | public 11 | class function GetBaseType : WideString; override; 12 | procedure InitNew; override; 13 | end; 14 | 15 | const 16 | RT_XPMANIFEST = MakeIntResource(24); 17 | 18 | implementation 19 | 20 | { TXPManifestResourceDetails } 21 | 22 | const 23 | 24 | manifest : string = 25 | ''#13#10+ 26 | ''#13#10+ 28 | ''#13#10+ 33 | 'Windows Shell'#13#10+ 34 | ''#13#10+ 35 | ' '#13#10+ 36 | ' '#13#10+ 44 | ' '#13#10+ 45 | ''#13#10+ 46 | ''; 47 | 48 | 49 | class function TXPManifestResourceDetails.GetBaseType: WideString; 50 | begin 51 | Result := IntToStr (Integer (RT_XPMANIFEST)); 52 | end; 53 | 54 | procedure TXPManifestResourceDetails.InitNew; 55 | begin 56 | Data.Clear; 57 | Data.Write(PChar (manifest)^, Length(manifest)) 58 | end; 59 | 60 | initialization 61 | RegisterResourceDetails(TXPManifestResourceDetails); 62 | finalization 63 | UnregisterResourceDetails(TXPManifestResourceDetails); 64 | end. 65 | -------------------------------------------------------------------------------- /Source/CursorGraphicsResourceForm.pas: -------------------------------------------------------------------------------- 1 | unit CursorGraphicsResourceForm; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 7 | Dialogs, IconCursorGraphicsResourceForm, Menus, ActnList, Actions, ImgList, 8 | ComCtrls, ExtCtrls, ToolWin, ImageList, ComponentColorSelector, 9 | ComponentSizingPageControl, ComponentBitmapEditor, ComponentPropertyListBox, 10 | unitExIcon; 11 | 12 | type 13 | TFormCursorGraphicsResource = class(TFormIconCursorGraphicsResource) 14 | MenuItemSetHotspot: TMenuItem; 15 | procedure actImageHotSpotExecute(Sender: TObject); 16 | procedure MenuItemSetHotspotClick(Sender: TObject); 17 | procedure FormCreate(Sender: TObject); 18 | private 19 | function GetCursor: TExCursor; 20 | procedure SetHotspot(const ScreenPt: TPoint); 21 | protected 22 | procedure SetObject(const Value: TObject); override; 23 | procedure PropertyListBoxPropertyChanged(Sender: TObject); override; 24 | public 25 | procedure PreviewKey(var key: Word; shift: TShiftState); override; 26 | procedure SaveResource(const undoDetails: string); override; 27 | 28 | property Cursor: TExCursor read GetCursor; 29 | end; 30 | 31 | implementation 32 | 33 | {$R *.dfm} 34 | 35 | resourcestring 36 | rstHotX = 'Hot Spot Left'; 37 | rstHotY = 'Hot Spot Top'; 38 | rstHotspotChanged = 'hotspot change'; 39 | 40 | const 41 | crCurrentCursor = 10; 42 | 43 | taHotX = 20; 44 | taHotY = 21; 45 | 46 | 47 | { TfmCursorGraphicsResource } 48 | 49 | procedure TFormCursorGraphicsResource.SetHotspot(const ScreenPt: TPoint); 50 | var 51 | pt: TPoint; 52 | change: string; 53 | begin 54 | pt := ScreenPt; 55 | MapWindowPoints (0, BitmapEditor.Handle, pt, 1); 56 | pt.X := pt.X div BitmapEditor.Magnification; 57 | pt.Y := pt.Y div BitmapEditor.Magnification; 58 | 59 | Cursor.Hotspot := pt.X + pt.Y shl 16; 60 | change := rstHotspotChanged; 61 | BitmapEditor.HotSpotX := LoWord(Self.Cursor.Hotspot); 62 | BitmapEditor.HotSpotY := HiWord(Self.Cursor.Hotspot); 63 | BitmapEditor.Picture := Image.Picture; // Set the editor picture 64 | SaveResource(change); 65 | end; 66 | 67 | procedure TFormCursorGraphicsResource.actImageHotSpotExecute(Sender: TObject); 68 | begin 69 | inherited; 70 | // 71 | end; 72 | 73 | procedure TFormCursorGraphicsResource.FormCreate(Sender: TObject); 74 | begin 75 | inherited; 76 | 77 | with TPropertyListProperty(PropertyListBox.Properties.Add) do 78 | begin 79 | PropertyName := 'Hot Spot Left'; 80 | PropertyType := ptInteger; 81 | ParentColor := False; 82 | Color := clBlack; 83 | ReadOnly := False; 84 | end; 85 | with TPropertyListProperty(PropertyListBox.Properties.Add) do 86 | begin 87 | PropertyName := 'Hot Spot Top'; 88 | PropertyType := ptInteger; 89 | ParentColor := False; 90 | Color := clBlack; 91 | ReadOnly := False; 92 | end; 93 | end; 94 | 95 | function TFormCursorGraphicsResource.GetCursor: TExCursor; 96 | begin 97 | Result := TExCursor(Image.Picture.Graphic); 98 | end; 99 | 100 | procedure TFormCursorGraphicsResource.PreviewKey(var key: Word; 101 | shift: TShiftState); 102 | begin 103 | inherited; 104 | case key of 105 | VK_MULTIPLY : 106 | SetHotspot(Mouse.CursorPos); 107 | end; 108 | end; 109 | 110 | procedure TFormCursorGraphicsResource.PropertyListBoxPropertyChanged( 111 | Sender: TObject); 112 | var 113 | change: string; 114 | prop: TPropertyListProperty; 115 | begin 116 | with PropertyListBox do 117 | prop := Properties[SelectedPropertyNo]; 118 | 119 | change := ''; 120 | 121 | case Prop.Tag of 122 | taHotX : 123 | begin 124 | Cursor.Hotspot := (Cursor.Hotspot and $ffff0000) or Prop.PropertyValue; 125 | change := rstHotspotChanged; 126 | BitmapEditor.HotSpotX := LoWord (Self.Cursor.Hotspot); 127 | end; 128 | taHotY : 129 | begin 130 | Cursor.Hotspot := (Cursor.Hotspot and $0000ffff) or (Prop.PropertyValue shl 16); 131 | change := rstHotspotChanged; 132 | BitmapEditor.HotSpotY := HiWord (Self.Cursor.Hotspot); 133 | end; 134 | end; 135 | 136 | if change <> '' then 137 | begin 138 | BitmapEditor.Picture := Image.Picture; // Set the editor picture 139 | SaveResource(change); 140 | end 141 | else 142 | inherited; 143 | end; 144 | 145 | procedure TFormCursorGraphicsResource.SaveResource(const undoDetails: string); 146 | begin 147 | inherited; 148 | Screen.Cursors[crCurrentCursor] := Cursor.Handle; 149 | end; 150 | 151 | type 152 | TCrackPopupMenu = class (TPopupMenu) 153 | end; 154 | 155 | procedure TFormCursorGraphicsResource.MenuItemSetHotspotClick(Sender: TObject); 156 | var 157 | pt: TPoint; 158 | begin 159 | pt := PopupMenu.PopupPoint; 160 | if pt.X = -1 then 161 | pt := Mouse.CursorPos; 162 | SetHotspot(pt); 163 | pt.x := -1; 164 | pt.y := -1; 165 | TCrackPopupMenu(PopupMenu).SetPopupPoint(pt); 166 | end; 167 | 168 | procedure TFormCursorGraphicsResource.SetObject(const Value: TObject); 169 | begin 170 | inherited; 171 | 172 | with PropertyListBox do // Set the properties 173 | begin 174 | with FindProperty(rstHotX) do 175 | begin 176 | Tag := taHotX; 177 | PropertyValue := LoWord (Self.Cursor.Hotspot); 178 | end; 179 | 180 | with FindProperty(rstHotY) do 181 | begin 182 | Tag := taHotY; 183 | PropertyValue := HiWord (Self.Cursor.Hotspot); 184 | end 185 | end; 186 | 187 | Screen.Cursors[crCurrentCursor] := Cursor.Handle; 188 | ScrollBoxThumbnail.Cursor := crCurrentCursor; 189 | BitmapEditor.HotSpotX := LoWord (Self.Cursor.Hotspot); 190 | BitmapEditor.HotSpotY := HiWord (Self.Cursor.Hotspot); 191 | end; 192 | 193 | end. 194 | -------------------------------------------------------------------------------- /Source/DescriptionRCDataResourceForm.dfm: -------------------------------------------------------------------------------- 1 | inherited FormRCDataDescriptionResource: TFormRCDataDescriptionResource 2 | Left = 330 3 | Top = 200 4 | Caption = 'RC Data Description Resource' 5 | PixelsPerInch = 96 6 | TextHeight = 13 7 | object LabelDescription: TLabel 8 | Left = 16 9 | Top = 16 10 | Width = 81 11 | Height = 13 12 | AutoSize = False 13 | Caption = '&Description' 14 | end 15 | object EditDescription: TEdit 16 | Left = 112 17 | Top = 12 18 | Width = 185 19 | Height = 21 20 | TabOrder = 0 21 | OnExit = EditDescriptionExit 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /Source/DescriptionRCDataResourceForm.pas: -------------------------------------------------------------------------------- 1 | unit DescriptionRCDataResourceForm; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 | StdCtrls, ResourceForm; 8 | 9 | type 10 | TFormRCDataDescriptionResource = class(TFormResource) 11 | LabelDescription: TLabel; 12 | EditDescription: TEdit; 13 | procedure EditDescriptionExit(Sender: TObject); 14 | private 15 | procedure SaveResource(const undoDetails : string); 16 | protected 17 | procedure SetObject(const Value: TObject); override; 18 | public 19 | procedure UpdateFonts; override; 20 | end; 21 | 22 | implementation 23 | 24 | uses 25 | unitResourceRCData; 26 | 27 | {$R *.DFM} 28 | 29 | resourcestring 30 | rstChangeDescription = 'change description'; 31 | 32 | { TFormRCDataDescriptionResource } 33 | 34 | procedure TFormRCDataDescriptionResource.SetObject(const Value: TObject); 35 | var 36 | Details : TRCDataDescriptionResourceDetails; 37 | begin 38 | inherited; 39 | 40 | Details := Obj as TRCDataDescriptionResourceDetails; 41 | EditDescription.Text := Details.Description 42 | end; 43 | 44 | procedure TFormRCDataDescriptionResource.UpdateFonts; 45 | begin 46 | UseInternationalFont(EditDescription.Font); 47 | end; 48 | 49 | procedure TFormRCDataDescriptionResource.SaveResource(const undoDetails : string); 50 | var 51 | Details: TRCDataDescriptionResourceDetails; 52 | begin 53 | AddUndoEntry(undoDetails); 54 | Details := Obj as TRCDataDescriptionResourceDetails; 55 | Details.Description := EditDescription.Text 56 | end; 57 | 58 | procedure TFormRCDataDescriptionResource.EditDescriptionExit(Sender: TObject); 59 | begin 60 | if EditDescription.CanUndo then 61 | SaveResource(rstChangeDescription); 62 | end; 63 | 64 | end. 65 | -------------------------------------------------------------------------------- /Source/FormResourceForm.dfm: -------------------------------------------------------------------------------- 1 | inherited FormRCDataFormResource: TFormRCDataFormResource 2 | ActiveControl = Memo 3 | Caption = 'RC Dataform Resource' 4 | PixelsPerInch = 96 5 | TextHeight = 13 6 | object Memo: TMemo 7 | Left = 0 8 | Top = 0 9 | Width = 701 10 | Height = 455 11 | Align = alClient 12 | Font.Charset = ANSI_CHARSET 13 | Font.Color = clWindowText 14 | Font.Height = -13 15 | Font.Name = 'Courier New' 16 | Font.Style = [] 17 | ParentFont = False 18 | ScrollBars = ssBoth 19 | TabOrder = 0 20 | OnExit = MemoExit 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /Source/FormResourceForm.pas: -------------------------------------------------------------------------------- 1 | unit FormResourceForm; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 | ResourceForm, StdCtrls, unitResourceRCData; 8 | 9 | type 10 | TFormRCDataFormResource = class(TFormResource) 11 | Memo: TMemo; 12 | procedure MemoExit(Sender: TObject); 13 | private 14 | FDetails: TRCDataFormResourceDetails; 15 | procedure SaveResource(const undoDetails : string); 16 | public 17 | procedure SetObject(const Value: TObject); override; 18 | end; 19 | 20 | implementation 21 | 22 | {$R *.DFM} 23 | 24 | resourcestring 25 | rstFormChange = 'form change'; 26 | 27 | { TFormRCDataFormResource } 28 | 29 | procedure TFormRCDataFormResource.SetObject(const Value: TObject); 30 | begin 31 | inherited; 32 | 33 | FDetails := obj as TRCDataFormResourceDetails; 34 | 35 | Memo.Text := FDetails.Text 36 | end; 37 | 38 | procedure TFormRCDataFormResource.MemoExit(Sender: TObject); 39 | begin 40 | inherited; 41 | 42 | if Memo.CanUndo then 43 | SaveResource(rstFormChange); 44 | end; 45 | 46 | procedure TFormRCDataFormResource.SaveResource(const undoDetails: string); 47 | begin 48 | AddUndoEntry(undoDetails); 49 | FDetails.Text := Memo.Text 50 | end; 51 | 52 | end. 53 | -------------------------------------------------------------------------------- /Source/FormTextInput.dfm: -------------------------------------------------------------------------------- 1 | object FormTextInput: TFormTextInput 2 | Left = 0 3 | Top = 0 4 | BorderStyle = bsSizeToolWin 5 | Caption = 'Text Input' 6 | ClientHeight = 210 7 | ClientWidth = 390 8 | Color = clBtnFace 9 | Constraints.MinHeight = 131 10 | Constraints.MinWidth = 253 11 | Font.Charset = DEFAULT_CHARSET 12 | Font.Color = clWindowText 13 | Font.Height = -11 14 | Font.Name = 'MS Shell Dlg 2' 15 | Font.Style = [] 16 | OldCreateOrder = False 17 | Position = poMainFormCenter 18 | DesignSize = ( 19 | 390 20 | 210) 21 | PixelsPerInch = 96 22 | TextHeight = 13 23 | object mmoText: TMemo 24 | Left = 8 25 | Top = 8 26 | Width = 293 27 | Height = 191 28 | Anchors = [akLeft, akTop, akRight, akBottom] 29 | TabOrder = 0 30 | end 31 | object ButtonOK: TButton 32 | Left = 307 33 | Top = 143 34 | Width = 75 35 | Height = 25 36 | Anchors = [akRight, akBottom] 37 | Caption = 'OK' 38 | Default = True 39 | ModalResult = 1 40 | TabOrder = 1 41 | end 42 | object ButtonSelectFont: TButton 43 | Left = 307 44 | Top = 8 45 | Width = 75 46 | Height = 25 47 | Anchors = [akTop, akRight] 48 | Caption = '&Font...' 49 | TabOrder = 2 50 | OnClick = ButtonSelectFontClick 51 | end 52 | object ButtonCancel: TButton 53 | Left = 307 54 | Top = 174 55 | Width = 75 56 | Height = 25 57 | Anchors = [akRight, akBottom] 58 | Cancel = True 59 | Caption = 'Cancel' 60 | ModalResult = 2 61 | TabOrder = 3 62 | end 63 | object FontDialog: TFontDialog 64 | Font.Charset = DEFAULT_CHARSET 65 | Font.Color = clWindowText 66 | Font.Height = -11 67 | Font.Name = 'MS Shell Dlg 2' 68 | Font.Style = [] 69 | Left = 320 70 | Top = 40 71 | end 72 | end 73 | -------------------------------------------------------------------------------- /Source/FormTextInput.pas: -------------------------------------------------------------------------------- 1 | unit FormTextInput; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 | StdCtrls; 8 | 9 | type 10 | TFormTextInput = class(TForm) 11 | mmoText: TMemo; 12 | ButtonOK: TButton; 13 | ButtonSelectFont: TButton; 14 | ButtonCancel: TButton; 15 | FontDialog: TFontDialog; 16 | procedure ButtonSelectFontClick(Sender: TObject); 17 | end; 18 | 19 | implementation 20 | 21 | {$R *.dfm} 22 | 23 | { TfmTextInput } 24 | 25 | procedure TFormTextInput.ButtonSelectFontClick(Sender: TObject); 26 | begin 27 | FontDialog.Font.Assign(mmoText.Font); 28 | if FontDialog.Execute then 29 | mmoText.Font.Assign(FontDialog.Font) 30 | end; 31 | 32 | end. 33 | -------------------------------------------------------------------------------- /Source/GraphicsResourceForm.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/GraphicsResourceForm.pas -------------------------------------------------------------------------------- /Source/GroupResourceForm.dfm: -------------------------------------------------------------------------------- 1 | inherited FormGroupResource: TFormGroupResource 2 | Left = 294 3 | Top = 207 4 | Caption = 'Group Resource' 5 | PixelsPerInch = 96 6 | TextHeight = 13 7 | object ScrollBox: TScrollBox 8 | Left = 0 9 | Top = 0 10 | Width = 701 11 | Height = 455 12 | Align = alClient 13 | TabOrder = 0 14 | object Image: TImage 15 | Left = 8 16 | Top = 8 17 | Width = 32 18 | Height = 32 19 | AutoSize = True 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /Source/GroupResourceForm.pas: -------------------------------------------------------------------------------- 1 | unit GroupResourceForm; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 | ExtCtrls, ResourceForm; 8 | 9 | type 10 | TFormGroupResource = class(TFormResource) 11 | ScrollBox: TScrollBox; 12 | Image: TImage; 13 | protected 14 | procedure SetObject(const Value: TObject); override; 15 | function GetImportExportType: TImportExportType; override; 16 | function GetCanCopy : Boolean; override; 17 | public 18 | procedure Copy; override; 19 | end; 20 | 21 | implementation 22 | 23 | uses 24 | Clipbrd, unitResourceGraphics; 25 | 26 | {$R *.DFM} 27 | 28 | { TfmGroupResource } 29 | 30 | procedure TFormGroupResource.Copy; 31 | begin 32 | Clipboard.Assign(Image.Picture.Graphic); 33 | end; 34 | 35 | function TFormGroupResource.GetCanCopy: Boolean; 36 | begin 37 | Result := True; 38 | end; 39 | 40 | function TFormGroupResource.GetImportExportType: TImportExportType; 41 | begin 42 | Result := ixPicture; 43 | end; 44 | 45 | procedure TFormGroupResource.SetObject(const Value: TObject); 46 | var 47 | Details: TIconCursorGroupResourceDetails; 48 | begin 49 | inherited; 50 | 51 | Details := obj as TIconCursorGroupResourceDetails; 52 | Details.GetImage(Image.Picture); 53 | end; 54 | 55 | end. 56 | -------------------------------------------------------------------------------- /Source/HelpContext.pas: -------------------------------------------------------------------------------- 1 | unit HelpContext; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Classes, SysUtils; 7 | 8 | const 9 | NO_CONTEXTS = 2; 10 | hcAddResourceDialog = 1000; 11 | hcNewImageDialog = 1001; 12 | 13 | function HelpLink(context : THelpContext) : string; 14 | 15 | implementation 16 | 17 | type 18 | THelpLink = record 19 | context : THelpContext; 20 | jump : string; 21 | end; 22 | 23 | const 24 | HelpLinks : array [0..NO_CONTEXTS - 1] of THelpLink = ( 25 | (context:hcAddResourceDialog; jump:'AddResourceDialog.htm'), 26 | (context:hcNewImageDialog; jump:'NewImage.htm') 27 | ); 28 | 29 | function HelpLink(context : THelpContext) : string; 30 | 31 | function bsearch(s, e : Integer) : string; 32 | var 33 | m : Integer; 34 | begin 35 | if e >= s then 36 | begin 37 | m := s + (e - s) div 2; 38 | 39 | if context > HelpLinks[m].context then 40 | Result := bsearch(m + 1, e) 41 | else 42 | if context < HelpLinks[m].context then 43 | Result := bsearch(s, m - 1) 44 | else 45 | Result := HelpLinks[m].jump 46 | end 47 | else 48 | Result := 'notfound.htm'; 49 | end; 50 | 51 | begin 52 | Result := bsearch(0, NO_CONTEXTS - 1) 53 | end; 54 | 55 | end. 56 | -------------------------------------------------------------------------------- /Source/IconCursorGraphicsResourceForm.pas: -------------------------------------------------------------------------------- 1 | unit IconCursorGraphicsResourceForm; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 | Menus, ActnList, ImgList, ComCtrls, ExtCtrls, ToolWin, Actions, ImageList, 8 | GraphicsResourceForm, ComponentColorSelector, ComponentSizingPageControl, 9 | ComponentBitmapEditor, ComponentPropertyListBox; 10 | 11 | type 12 | TFormIconCursorGraphicsResource = class(TFormGraphicsResource) 13 | end; 14 | 15 | implementation 16 | 17 | {$R *.dfm} 18 | 19 | end. 20 | -------------------------------------------------------------------------------- /Source/IconGraphicsResourceForm.pas: -------------------------------------------------------------------------------- 1 | unit IconGraphicsResourceForm; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 | Menus, ActnList, ImgList, ComCtrls, Actions, ImageList, ExtCtrls, ToolWin, 8 | IconCursorGraphicsResourceForm, ComponentColorSelector, 9 | ComponentSizingPageControl, ComponentBitmapEditor, 10 | ComponentPropertyListBox; 11 | 12 | type 13 | TFormIconGraphicsResource = class(TFormIconCursorGraphicsResource) 14 | procedure FormCreate(Sender: TObject); 15 | end; 16 | 17 | implementation 18 | 19 | {$R *.dfm} 20 | 21 | procedure TFormIconGraphicsResource.FormCreate(Sender: TObject); 22 | begin 23 | inherited; 24 | 25 | with TPropertyListProperty(PropertyListBox.Properties.Add) do 26 | begin 27 | PropertyName := 'Hot Spot Left'; 28 | PropertyType := ptInteger; 29 | ParentColor := False; 30 | Color := clBlack; 31 | ReadOnly := False; 32 | end; 33 | with TPropertyListProperty(PropertyListBox.Properties.Add) do 34 | begin 35 | PropertyName := 'Hot Spot Top'; 36 | PropertyType := ptInteger; 37 | ParentColor := False; 38 | Color := clBlack; 39 | ReadOnly := False; 40 | end; 41 | end; 42 | 43 | end. 44 | -------------------------------------------------------------------------------- /Source/MenuResourceForm.dfm: -------------------------------------------------------------------------------- 1 | inherited FormMenuResource: TFormMenuResource 2 | Left = 315 3 | Top = 221 4 | ActiveControl = PropertyListBox 5 | Caption = 'Menu Resource' 6 | OnShow = FormShow 7 | PixelsPerInch = 96 8 | TextHeight = 13 9 | object Splitter: TSplitter 10 | Left = 185 11 | Top = 0 12 | Height = 455 13 | end 14 | object PanelProperties: TPanel 15 | Left = 0 16 | Top = 0 17 | Width = 185 18 | Height = 455 19 | Align = alLeft 20 | BevelOuter = bvLowered 21 | FullRepaint = False 22 | TabOrder = 0 23 | object PropertyListBox: TPropertyListBox 24 | Left = 1 25 | Top = 1 26 | Width = 183 27 | Height = 453 28 | VertScrollBar.Increment = 17 29 | VertScrollBar.Range = 85 30 | Align = alClient 31 | BorderStyle = bsNone 32 | TabOrder = 0 33 | TabStop = False 34 | Properties = < 35 | item 36 | PropertyName = 'Caption' 37 | PropertyType = ptString 38 | Tag = 0 39 | ParentColor = False 40 | Color = clBlack 41 | ReadOnly = False 42 | end 43 | item 44 | PropertyName = 'Shortcut' 45 | PropertyType = ptEnum 46 | Tag = 0 47 | ParentColor = False 48 | Color = clBlack 49 | ReadOnly = False 50 | end 51 | item 52 | PropertyName = 'ID' 53 | PropertyType = ptInteger 54 | Tag = 0 55 | ParentColor = False 56 | Color = clBlack 57 | ReadOnly = False 58 | end 59 | item 60 | PropertyName = 'Enabled' 61 | PropertyType = ptBoolean 62 | Tag = 0 63 | ParentColor = False 64 | Color = clBlack 65 | ReadOnly = False 66 | end 67 | item 68 | PropertyName = 'Checked' 69 | PropertyType = ptBoolean 70 | Tag = 0 71 | ParentColor = False 72 | Color = clBlack 73 | ReadOnly = False 74 | end> 75 | ActualValueColWidth = 0 76 | OnPropertyChanged = PropertyListBoxPropertyChanged 77 | end 78 | end 79 | object PanelMain: TPanel 80 | Left = 188 81 | Top = 0 82 | Width = 513 83 | Height = 455 84 | Align = alClient 85 | BevelOuter = bvLowered 86 | FullRepaint = False 87 | TabOrder = 1 88 | object MenuDesigner: TMenuDesigner 89 | Left = 1 90 | Top = 1 91 | Width = 511 92 | Height = 453 93 | OnSelectedItemChange = MenuDesignerSelectedItemChange 94 | Align = alClient 95 | UseDockManager = False 96 | PopupMenu = PopupMenu 97 | TabOrder = 0 98 | TabStop = True 99 | OnKeyDown = MenuDesignerKeyDown 100 | end 101 | end 102 | object ActionListMenu: TActionList 103 | Left = 660 104 | Top = 40 105 | object ActionMenuDeleteItem: TAction 106 | Category = 'Menu' 107 | Caption = '&Delete Item' 108 | ShortCut = 46 109 | OnExecute = ActionMenuDeleteItemExecute 110 | end 111 | object ActionMenuInsertItem: TAction 112 | Category = 'Menu' 113 | Caption = '&Add &Item Before' 114 | ShortCut = 45 115 | OnExecute = ActionMenuInsertItemExecute 116 | end 117 | object ActionMenuAppendItem: TAction 118 | Category = 'Menu' 119 | Caption = '&Add Item After' 120 | ShortCut = 8237 121 | OnExecute = ActionMenuAppendItemExecute 122 | end 123 | object ActionMenuAddChildItem: TAction 124 | Category = 'Menu' 125 | Caption = 'Add &Child Item' 126 | OnExecute = ActionMenuAddChildItemExecute 127 | end 128 | end 129 | object MainMenuMenu: TMainMenu 130 | Left = 660 131 | Top = 80 132 | object MenuItemMenuITem: TMenuItem 133 | Caption = '&Menu' 134 | object MenuItemInsertItem2: TMenuItem 135 | Action = ActionMenuInsertItem 136 | end 137 | object MenuItemAddItemAfter2: TMenuItem 138 | Action = ActionMenuAppendItem 139 | end 140 | object MenuItemAddChildItem2: TMenuItem 141 | Action = ActionMenuAddChildItem 142 | end 143 | object N2: TMenuItem 144 | Caption = '-' 145 | end 146 | object MenuItemMenuDeleteItem2: TMenuItem 147 | Action = ActionMenuDeleteItem 148 | end 149 | end 150 | end 151 | object PopupMenu: TPopupMenu 152 | Left = 660 153 | Top = 120 154 | object MenuItemInsertItem: TMenuItem 155 | Action = ActionMenuInsertItem 156 | end 157 | object MenuItemAddItemAfter: TMenuItem 158 | Action = ActionMenuAppendItem 159 | end 160 | object MenuItemAddChildItem: TMenuItem 161 | Action = ActionMenuAddChildItem 162 | end 163 | object N1: TMenuItem 164 | Caption = '-' 165 | end 166 | object MenuItemMenuDeleteItem: TMenuItem 167 | Action = ActionMenuDeleteItem 168 | end 169 | end 170 | end 171 | -------------------------------------------------------------------------------- /Source/PackagesResourceForm.dfm: -------------------------------------------------------------------------------- 1 | inherited FormPackagesResource: TFormPackagesResource 2 | Left = 219 3 | Top = 214 4 | ActiveControl = PageControlRequiresContains 5 | Caption = 'Packages Resource' 6 | OnShow = FormShow 7 | PixelsPerInch = 96 8 | TextHeight = 13 9 | object Splitter: TSplitter 10 | Left = 185 11 | Top = 0 12 | Height = 455 13 | end 14 | object PageControlRequiresContains: TPageControl 15 | Left = 188 16 | Top = 0 17 | Width = 513 18 | Height = 455 19 | ActivePage = TabSheetRequires 20 | Align = alClient 21 | TabOrder = 0 22 | object TabSheetRequires: TTabSheet 23 | Caption = 'Requires' 24 | ImageIndex = 1 25 | ExplicitLeft = 0 26 | ExplicitTop = 0 27 | ExplicitWidth = 0 28 | ExplicitHeight = 0 29 | object ListViewRequires: TListView 30 | Left = 0 31 | Top = 0 32 | Width = 505 33 | Height = 427 34 | Align = alClient 35 | Columns = < 36 | item 37 | Caption = 'Requires Packages' 38 | Width = -2 39 | WidthType = ( 40 | -2) 41 | end> 42 | ColumnClick = False 43 | GridLines = True 44 | ReadOnly = True 45 | TabOrder = 0 46 | ViewStyle = vsReport 47 | end 48 | end 49 | object TabSheetContains: TTabSheet 50 | Caption = 'Contains' 51 | ImageIndex = 2 52 | ExplicitLeft = 0 53 | ExplicitTop = 0 54 | ExplicitWidth = 0 55 | ExplicitHeight = 0 56 | object ListViewContains: TListView 57 | Left = 0 58 | Top = 0 59 | Width = 505 60 | Height = 427 61 | Align = alClient 62 | Columns = < 63 | item 64 | Caption = 'Contains Unit' 65 | Width = 300 66 | end 67 | item 68 | AutoSize = True 69 | Caption = 'Flags' 70 | end> 71 | GridLines = True 72 | ReadOnly = True 73 | SortType = stText 74 | TabOrder = 0 75 | ViewStyle = vsReport 76 | end 77 | end 78 | end 79 | object Panel: TPanel 80 | Left = 0 81 | Top = 0 82 | Width = 185 83 | Height = 455 84 | Align = alLeft 85 | BevelOuter = bvLowered 86 | FullRepaint = False 87 | TabOrder = 1 88 | object PropertyListBoxFlags: TPropertyListBox 89 | Left = 1 90 | Top = 1 91 | Width = 183 92 | Height = 453 93 | VertScrollBar.Increment = 17 94 | VertScrollBar.Range = 102 95 | Align = alClient 96 | BorderStyle = bsNone 97 | TabOrder = 0 98 | TabStop = False 99 | Properties = < 100 | item 101 | PropertyName = 'Never Build' 102 | PropertyType = ptBoolean 103 | Tag = 0 104 | Enabled = False 105 | ParentColor = False 106 | Color = clBlack 107 | ReadOnly = False 108 | end 109 | item 110 | PropertyName = 'Design Only' 111 | PropertyType = ptBoolean 112 | Tag = 0 113 | Enabled = False 114 | ParentColor = False 115 | Color = clBlack 116 | ReadOnly = False 117 | end 118 | item 119 | PropertyName = 'Runtime Only' 120 | PropertyType = ptBoolean 121 | Tag = 0 122 | Enabled = False 123 | ParentColor = False 124 | Color = clBlack 125 | ReadOnly = False 126 | end 127 | item 128 | PropertyName = 'Check Duplicates' 129 | PropertyType = ptBoolean 130 | Tag = 0 131 | Enabled = False 132 | ParentColor = False 133 | Color = clBlack 134 | ReadOnly = False 135 | end 136 | item 137 | PropertyName = 'Environment' 138 | PropertyType = ptEnum 139 | Tag = 0 140 | EnumValues.Strings = ( 141 | 'Pre-V4' 142 | 'Undefined' 143 | 'C++ Builder' 144 | 'Delphi') 145 | Enabled = False 146 | ParentColor = False 147 | Color = clBlack 148 | ReadOnly = False 149 | end 150 | item 151 | PropertyName = 'Module Type' 152 | PropertyType = ptEnum 153 | Tag = 0 154 | EnumValues.Strings = ( 155 | 'EXE' 156 | 'Package DLL' 157 | 'Module DLL' 158 | 'Undefined') 159 | Enabled = False 160 | ParentColor = False 161 | Color = clBlack 162 | ReadOnly = False 163 | end> 164 | ActualValueColWidth = 0 165 | end 166 | end 167 | end 168 | -------------------------------------------------------------------------------- /Source/PackagesResourceForm.pas: -------------------------------------------------------------------------------- 1 | unit PackagesResourceForm; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 | ComCtrls, ExtCtrls, ResourceForm, ComponentPropertyListBox, 8 | unitResourceRCData; 9 | 10 | type 11 | TFormPackagesResource = class(TFormResource) 12 | ListViewContains: TListView; 13 | ListViewRequires: TListView; 14 | PageControlRequiresContains: TPageControl; 15 | Panel: TPanel; 16 | PropertyListBoxFlags: TPropertyListBox; 17 | Splitter: TSplitter; 18 | TabSheetContains: TTabSheet; 19 | TabSheetRequires: TTabSheet; 20 | procedure FormShow(Sender: TObject); 21 | private 22 | FDetails: TRCDataPackagesResourceDetails; 23 | public 24 | procedure SetObject(const Value: TObject); override; 25 | end; 26 | 27 | implementation 28 | 29 | {$R *.DFM} 30 | 31 | { TFormPackagesResource } 32 | 33 | procedure TFormPackagesResource.SetObject(const Value: TObject); 34 | var 35 | Prop: TPropertyListProperty; 36 | i: Integer; 37 | st: string; 38 | Flgs: Integer; 39 | begin 40 | inherited; 41 | 42 | FDetails := Obj as TRCDataPackagesResourceDetails; 43 | 44 | Prop := PropertyListBoxFlags.FindProperty('Environment'); 45 | Prop.PropertyValue := FDetails.Environment; 46 | 47 | Prop := PropertyListBoxFlags.FindProperty('Module Type'); 48 | Prop.PropertyValue := FDetails.ModuleType; 49 | 50 | Prop := PropertyListBoxFlags.FindProperty('Never Build'); 51 | Prop.PropertyValue := FDetails.NeverBuild; 52 | 53 | Prop := PropertyListBoxFlags.FindProperty('Design Only'); 54 | Prop.PropertyValue := FDetails.DesignTimeOnly; 55 | 56 | Prop := PropertyListBoxFlags.FindProperty('Runtime Only'); 57 | Prop.PropertyValue := FDetails.RuntimeOnly; 58 | 59 | Prop := PropertyListBoxFlags.FindProperty('Check Duplicates'); 60 | Prop.PropertyValue := FDetails.CheckForDuplicates; 61 | 62 | ListViewRequires.Items.BeginUpdate; 63 | try 64 | for i := 0 to FDetails.RequiresCount - 1 do 65 | with ListViewRequires.Items.Add do 66 | Caption := FDetails.Requires[i]; 67 | if ListViewRequires.Items.Count > 0 then 68 | ListViewRequires.ItemIndex := 0; 69 | finally 70 | ListViewRequires.Items.EndUpdate 71 | end; 72 | 73 | ListViewContains.Items.BeginUpdate; 74 | try 75 | for i := 0 to FDetails.ContainsCount - 1 do 76 | with ListViewContains.Items.Add do 77 | begin 78 | Caption := FDetails.Contains[i]; 79 | { PackageUnitFlags: 80 | bit meaning 81 | ----------------------------------------------------------------------------------------- 82 | 0 | main unit 83 | 1 | package unit(dpk source) 84 | 2 | $WEAKPACKAGEUNIT unit 85 | 3 | original containment of $WEAKPACKAGEUNIt(package into which it was compiled) 86 | 4 | implicitly imported 87 | 5..7 | reserved 88 | } 89 | Flgs := FDetails.ContainsFlag [i]; 90 | 91 | st := ''; 92 | if (Flgs and 1) <> 0 then st := st + ', main unit'; 93 | if (Flgs and 2) <> 0 then st := st + ', package unit'; 94 | if (Flgs and 4) <> 0 then st := st + ', $WEAKPACKAGEUNIT unit'; 95 | if (Flgs and 8) <> 0 then st := st + ', original containment of $WEAKPACKAGEUNIT'; 96 | if (Flgs and 16) <> 0 then st := st + ', implictly imported'; 97 | 98 | system.Delete(st, 1, 2); 99 | SubItems.Add (st) 100 | end; 101 | 102 | if ListViewContains.Items.Count > 0 then 103 | ListViewContains.ItemIndex := 0 104 | 105 | finally 106 | ListViewContains.Items.EndUpdate 107 | end 108 | end; 109 | 110 | procedure TFormPackagesResource.FormShow(Sender: TObject); 111 | begin 112 | inherited; 113 | 114 | PageControlRequiresContains.ActivePageIndex := 0; 115 | end; 116 | 117 | end. 118 | -------------------------------------------------------------------------------- /Source/PropertiesForm.dfm: -------------------------------------------------------------------------------- 1 | inherited FormProperties: TFormProperties 2 | Caption = 'Options' 3 | PixelsPerInch = 96 4 | TextHeight = 13 5 | inherited PersistentPosition: TPersistentPosition 6 | Section = 'Options' 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /Source/PropertiesForm.pas: -------------------------------------------------------------------------------- 1 | unit PropertiesForm; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 | Menus, StdCtrls, ExtCtrls, VirtualTrees, PropertyBaseForm, 8 | ComponentPersistentPosition; 9 | 10 | type 11 | TFormProperties = class(TFormPropertyBase) 12 | procedure FormDestroy(Sender: TObject); 13 | public 14 | constructor Create(AOwner : TComponent); override; 15 | end; 16 | 17 | implementation 18 | 19 | uses 20 | unitCredProperties, PropertyPageProgramSettings, PropertyPageRCSettings; 21 | 22 | {$R *.DFM} 23 | 24 | { TFormProperties } 25 | 26 | constructor TFormProperties.Create(AOwner: TComponent); 27 | begin 28 | inherited; 29 | 30 | gProperties.BeginUpdate; 31 | AddPropertyPageDetails (TFormPropertyPageProgramSettings, nil); 32 | AddPropertyPageDetails (TFormPropertyPageRCSettings, nil); 33 | end; 34 | 35 | procedure TFormProperties.FormDestroy(Sender: TObject); 36 | begin 37 | inherited; 38 | gProperties.EndUpdate 39 | end; 40 | 41 | end. 42 | -------------------------------------------------------------------------------- /Source/PropertyBaseForm.dfm: -------------------------------------------------------------------------------- 1 | object FormPropertyBase: TFormPropertyBase 2 | Left = 374 3 | Top = 189 4 | ActiveControl = vstSections 5 | BorderIcons = [biSystemMenu] 6 | BorderWidth = 4 7 | ClientHeight = 358 8 | ClientWidth = 563 9 | Color = clBtnFace 10 | Font.Charset = DEFAULT_CHARSET 11 | Font.Color = clWindowText 12 | Font.Height = -11 13 | Font.Name = 'MS Sans Serif' 14 | Font.Style = [] 15 | KeyPreview = True 16 | OldCreateOrder = False 17 | Position = poDesigned 18 | OnDestroy = FormDestroy 19 | OnKeyDown = FormKeyDown 20 | OnShow = FormShow 21 | PixelsPerInch = 96 22 | TextHeight = 13 23 | object Splitter: TSplitter 24 | Left = 169 25 | Top = 0 26 | Width = 4 27 | Height = 323 28 | Beveled = True 29 | end 30 | object PanelOptions: TPanel 31 | Left = 173 32 | Top = 0 33 | Width = 390 34 | Height = 323 35 | Align = alClient 36 | BevelOuter = bvNone 37 | FullRepaint = False 38 | TabOrder = 1 39 | object Bevel: TBevel 40 | Left = 0 41 | Top = 320 42 | Width = 390 43 | Height = 3 44 | Align = alBottom 45 | Shape = bsBottomLine 46 | end 47 | end 48 | object vstSections: TVirtualStringTree 49 | Left = 0 50 | Top = 0 51 | Width = 169 52 | Height = 323 53 | Align = alLeft 54 | Header.AutoSizeIndex = 0 55 | Header.MainColumn = -1 56 | Header.Options = [hoColumnResize, hoDrag] 57 | NodeDataSize = 4 58 | PopupMenu = PopupMenu 59 | TabOrder = 0 60 | OnFocusChanged = vstSectionsFocusChanged 61 | OnGetText = vstSectionsGetText 62 | OnInitChildren = vstSectionsInitChildren 63 | OnInitNode = vstSectionsInitNode 64 | Columns = <> 65 | end 66 | object PanelButtons: TPanel 67 | Left = 0 68 | Top = 323 69 | Width = 563 70 | Height = 35 71 | Align = alBottom 72 | BevelOuter = bvNone 73 | TabOrder = 2 74 | DesignSize = ( 75 | 563 76 | 35) 77 | object ButtonOK: TButton 78 | Left = 241 79 | Top = 8 80 | Width = 75 81 | Height = 25 82 | Anchors = [akTop, akRight] 83 | Caption = 'OK' 84 | Default = True 85 | ModalResult = 1 86 | TabOrder = 0 87 | OnClick = ButtonOKClick 88 | end 89 | object ButtonCancel: TButton 90 | Left = 318 91 | Top = 8 92 | Width = 75 93 | Height = 25 94 | Anchors = [akTop, akRight] 95 | Cancel = True 96 | Caption = 'Cancel' 97 | ModalResult = 2 98 | TabOrder = 1 99 | end 100 | object ButtonApply: TButton 101 | Left = 395 102 | Top = 8 103 | Width = 75 104 | Height = 25 105 | Anchors = [akRight, akBottom] 106 | Caption = 'Apply' 107 | TabOrder = 2 108 | OnClick = ButtonApplyClick 109 | end 110 | object ButtonHelp: TButton 111 | Left = 480 112 | Top = 8 113 | Width = 75 114 | Height = 25 115 | Anchors = [akRight, akBottom] 116 | Caption = 'Help' 117 | TabOrder = 3 118 | OnClick = ButtonHelpClick 119 | end 120 | end 121 | object PersistentPosition: TPersistentPosition 122 | Manufacturer = 'Woozle' 123 | Product = 'XN Resource Editor' 124 | Left = 16 125 | Top = 332 126 | end 127 | object PopupMenu: TPopupMenu 128 | Left = 56 129 | Top = 328 130 | object MenuItemExpandAll: TMenuItem 131 | Caption = '&Expand All' 132 | OnClick = MenuItemExpandAllClick 133 | end 134 | object MenuItemCollapseAll: TMenuItem 135 | Caption = '&Collapse All' 136 | OnClick = MenuItemCollapseAllClick 137 | end 138 | end 139 | end 140 | -------------------------------------------------------------------------------- /Source/PropertyBaseForm.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/PropertyBaseForm.pas -------------------------------------------------------------------------------- /Source/PropertyPageForm.dfm: -------------------------------------------------------------------------------- 1 | object FormPropertyPage: TFormPropertyPage 2 | Left = 335 3 | Top = 221 4 | BorderStyle = bsNone 5 | Caption = 'fmPropertyPage' 6 | ClientHeight = 316 7 | ClientWidth = 373 8 | Color = clBtnFace 9 | Font.Charset = DEFAULT_CHARSET 10 | Font.Color = clWindowText 11 | Font.Height = -11 12 | Font.Name = 'MS Sans Serif' 13 | Font.Style = [] 14 | OldCreateOrder = False 15 | PixelsPerInch = 96 16 | TextHeight = 13 17 | object PanelSectionDetails: TPanel 18 | Left = 0 19 | Top = 0 20 | Width = 373 21 | Height = 41 22 | Align = alTop 23 | BevelOuter = bvNone 24 | TabOrder = 0 25 | DesignSize = ( 26 | 373 27 | 41) 28 | object Bevel: TBevel 29 | Left = 0 30 | Top = 38 31 | Width = 373 32 | Height = 3 33 | Align = alBottom 34 | Shape = bsBottomLine 35 | end 36 | object StaticTextSectionDetails: TLabel 37 | Left = 8 38 | Top = 6 39 | Width = 361 40 | Height = 29 41 | Anchors = [akLeft, akTop, akRight, akBottom] 42 | AutoSize = False 43 | ShowAccelChar = False 44 | WordWrap = True 45 | end 46 | end 47 | end 48 | -------------------------------------------------------------------------------- /Source/PropertyPageForm.pas: -------------------------------------------------------------------------------- 1 | unit PropertyPageForm; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 | ExtCtrls, StdCtrls; 8 | 9 | type 10 | TPropertyPageData = class 11 | private 12 | FCaption: string; 13 | FHelpText: string; 14 | FHelpKeyword: string; 15 | FParam: Integer; 16 | FMinX: Integer; 17 | FMinY: Integer; 18 | FInitialized: Boolean; 19 | protected 20 | 21 | property Param: Integer read FParam; 22 | procedure Initialize; virtual; abstract; 23 | function GetCaption: string; virtual; 24 | function GetHelpText: string; virtual; 25 | public 26 | constructor Create(const ACaption, AHelpText, AHelpKeyword: string; AMinCX, AMinCY: Integer; AParam: Integer = 0); 27 | procedure Apply; virtual; 28 | procedure Cancel; virtual; 29 | 30 | property Caption: string read GetCaption; 31 | property Initialized: Boolean read FInitialized write FInitialized; 32 | property HelpText: string read GetHelpText; 33 | property HelpKeyword: string read FHelpKeyword; 34 | 35 | property MinX: Integer read FMinX; 36 | property MinY: Integer read FMinY; 37 | end; 38 | 39 | TPropertyPageDataClass = class of TPropertyPageData; 40 | 41 | TFormPropertyPage = class(TForm) 42 | PanelSectionDetails: TPanel; 43 | Bevel: TBevel; 44 | StaticTextSectionDetails: TLabel; 45 | private 46 | FAltKeyword: string; 47 | protected 48 | FPopulating: Boolean; 49 | public 50 | class function GetDataClass: TPropertyPageDataClass; virtual; abstract; 51 | procedure PopulateControls (AData: TPropertyPageData); virtual; 52 | property Populating: Boolean read FPopulating write FPopulating; 53 | property AltKeyword: string read FAltKeyword; 54 | end; 55 | 56 | TPropertyPageClass = class of TFormPropertyPage; 57 | 58 | implementation 59 | 60 | {$R *.dfm} 61 | 62 | { TFormPropertyPage } 63 | 64 | procedure TFormPropertyPage.PopulateControls (AData: TPropertyPageData); 65 | begin 66 | if not AData.FInitialized then 67 | begin 68 | AData.Initialize; 69 | AData.FInitialized := True 70 | end; 71 | StaticTextSectionDetails.Caption := AData.HelpText; 72 | FAltKeyword := AData.HelpKeyword; 73 | end; 74 | 75 | { TPropertyPageData } 76 | 77 | procedure TPropertyPageData.Apply; 78 | begin 79 | // Stub 80 | end; 81 | 82 | procedure TPropertyPageData.Cancel; 83 | begin 84 | // Stub 85 | end; 86 | 87 | constructor TPropertyPageData.Create(const ACaption, AHelpText, AHelpKeyword: string; AMinCX, AMinCY: Integer; 88 | AParam: Integer); 89 | begin 90 | FCaption := ACaption; 91 | FHelpText := AHelpText; 92 | FHelpKeyword := AHelpKeyword; 93 | FParam := AParam; 94 | FMinX := AMinCX; 95 | FMinY := AMinCY; 96 | end; 97 | 98 | function TPropertyPageData.GetCaption: string; 99 | begin 100 | Result := FCaption 101 | end; 102 | 103 | function TPropertyPageData.GetHelpText: string; 104 | begin 105 | Result := FHelpText 106 | end; 107 | 108 | end. 109 | -------------------------------------------------------------------------------- /Source/PropertyPageProgramSettings.dfm: -------------------------------------------------------------------------------- 1 | inherited FormPropertyPageProgramSettings: TFormPropertyPageProgramSettings 2 | Caption = 'XN Resource Editor Options' 3 | ClientHeight = 191 4 | ClientWidth = 318 5 | Constraints.MinHeight = 191 6 | Constraints.MinWidth = 318 7 | ExplicitWidth = 318 8 | ExplicitHeight = 191 9 | PixelsPerInch = 96 10 | TextHeight = 13 11 | object LabelSelectFont: TLabel [0] 12 | Left = 16 13 | Top = 56 14 | Width = 274 15 | Height = 13 16 | Caption = 'Select a font to use when displaying and editing resources' 17 | end 18 | object StaticTextModuleParser: TLabel [1] 19 | Left = 16 20 | Top = 136 21 | Width = 286 22 | Height = 13 23 | Caption = 'Choose which parser to use when loading Windows modules' 24 | end 25 | inherited PanelSectionDetails: TPanel 26 | Width = 318 27 | ExplicitWidth = 318 28 | inherited Bevel: TBevel 29 | Width = 318 30 | ExplicitWidth = 269 31 | end 32 | inherited StaticTextSectionDetails: TLabel 33 | Width = 306 34 | ExplicitWidth = 257 35 | end 36 | end 37 | object StaticTextFontDetails: TStaticText 38 | Left = 24 39 | Top = 75 40 | Width = 258 41 | Height = 17 42 | Anchors = [akLeft, akTop, akRight] 43 | AutoSize = False 44 | BevelInner = bvNone 45 | BevelKind = bkTile 46 | TabOrder = 1 47 | end 48 | object ButtonSelectFont: TButton 49 | Left = 288 50 | Top = 71 51 | Width = 25 52 | Height = 25 53 | Anchors = [akTop, akRight] 54 | Caption = '...' 55 | TabOrder = 2 56 | OnClick = ButtonSelectFontClick 57 | end 58 | object ComboBoxModuleParser: TComboBox 59 | Left = 24 60 | Top = 155 61 | Width = 258 62 | Height = 21 63 | Style = csDropDownList 64 | ItemIndex = 0 65 | TabOrder = 3 66 | Text = 'Windows API resource parser' 67 | OnChange = ComboBoxModuleParserChange 68 | Items.Strings = ( 69 | 'Windows API resource parser' 70 | 'XN Resource Editor internal resource parser') 71 | end 72 | object FontDialog: TFontDialog 73 | Font.Charset = DEFAULT_CHARSET 74 | Font.Color = clWindowText 75 | Font.Height = -11 76 | Font.Name = 'MS Shell Dlg 2' 77 | Font.Style = [] 78 | Left = 272 79 | Top = 8 80 | end 81 | end 82 | -------------------------------------------------------------------------------- /Source/PropertyPageProgramSettings.pas: -------------------------------------------------------------------------------- 1 | unit PropertyPageProgramSettings; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 | StdCtrls, Menus, ExtCtrls, VirtualTrees, PropertyPageForm, 8 | ComponentPersistentPosition; 9 | 10 | type 11 | TPropertyPageProgramSettingsData = class (TPropertyPageData) 12 | private 13 | FInternationalFontName : string; 14 | FInternationalFontHeight : Integer; 15 | FParserType : Integer; // 0 = NT API; 1 = Internal 16 | protected 17 | procedure Initialize; override; 18 | public 19 | procedure Apply; override; 20 | end; 21 | 22 | TFormPropertyPageProgramSettings = class(TFormPropertyPage) 23 | FontDialog: TFontDialog; 24 | StaticTextFontDetails: TStaticText; 25 | ButtonSelectFont: TButton; 26 | LabelSelectFont: TLabel; 27 | StaticTextModuleParser: TLabel; 28 | ComboBoxModuleParser: TComboBox; 29 | procedure ComboBoxModuleParserChange(Sender: TObject); 30 | procedure ButtonSelectFontClick(Sender: TObject); 31 | private 32 | FData : TPropertyPageProgramSettingsData; 33 | public 34 | class function GetDataClass : TPropertyPageDataClass; override; 35 | procedure PopulateControls (AData : TPropertyPageData); override; 36 | end; 37 | 38 | implementation 39 | 40 | uses 41 | ResourceForm, unitCredProperties; 42 | 43 | {$R *.DFM} 44 | 45 | { TFormPropertyPageProgramSettings } 46 | 47 | procedure TFormPropertyPageProgramSettings.ButtonSelectFontClick(Sender: TObject); 48 | begin 49 | FontDialog.Font.Name := FData.FInternationalFontName; 50 | FontDialog.Font.Height := FData.FInternationalFontHeight; 51 | if FontDialog.Execute(Handle) then 52 | begin 53 | FData.FInternationalFontName := FontDialog.Font.Name; 54 | FData.FInternationalFontHeight := FontDialog.Font.Height; 55 | 56 | StaticTextFontDetails.Caption := FData.FInternationalFontName 57 | end; 58 | end; 59 | 60 | procedure TFormPropertyPageProgramSettings.ComboBoxModuleParserChange(Sender: TObject); 61 | begin 62 | FData.FParserType := ComboBoxModuleParser.ItemIndex 63 | end; 64 | 65 | class function TFormPropertyPageProgramSettings.GetDataClass: TPropertyPageDataClass; 66 | begin 67 | Result := TPropertyPageProgramSettingsData; 68 | end; 69 | 70 | procedure TFormPropertyPageProgramSettings.PopulateControls(AData: TPropertyPageData); 71 | begin 72 | inherited; 73 | FData := AData as TPropertyPageProgramSettingsData; 74 | StaticTextFontDetails.Caption := FData.FInternationalFontName; 75 | 76 | if Win32Platform = VER_PLATFORM_WIN32_NT then 77 | ComboBoxModuleParser.ItemIndex := FData.FParserType 78 | else 79 | begin 80 | ComboBoxModuleParser.Visible := False; 81 | StaticTextModuleParser.Visible := False; 82 | end 83 | end; 84 | 85 | { TPropertyPageProgramSettingsData } 86 | 87 | procedure TPropertyPageProgramSettingsData.Apply; 88 | begin 89 | SetInternationalFont(FInternationalFontName, FInternationalFontHeight); 90 | gProperties.ParserType := FParserType; 91 | end; 92 | 93 | procedure TPropertyPageProgramSettingsData.Initialize; 94 | begin 95 | FInternationalFontName := gProperties.InternationalFontName; 96 | FInternationalFontHeight := gProperties.InternationalFontHeight; 97 | FParserType := gProperties.ParserType; 98 | end; 99 | 100 | end. 101 | -------------------------------------------------------------------------------- /Source/PropertyPageRCSettings.dfm: -------------------------------------------------------------------------------- 1 | inherited FormPropertyPageRCSettings: TFormPropertyPageRCSettings 2 | ActiveControl = vstIncludePackages 3 | Caption = 'RC File Options' 4 | ClientHeight = 299 5 | ClientWidth = 278 6 | Constraints.MinHeight = 274 7 | Constraints.MinWidth = 269 8 | OnDestroy = FormDestroy 9 | ExplicitWidth = 278 10 | ExplicitHeight = 299 11 | PixelsPerInch = 96 12 | TextHeight = 13 13 | inherited PanelSectionDetails: TPanel 14 | Width = 278 15 | ExplicitWidth = 278 16 | inherited Bevel: TBevel 17 | Width = 278 18 | ExplicitWidth = 269 19 | end 20 | inherited StaticTextSectionDetails: TLabel 21 | Width = 266 22 | Caption = 23 | 'Select the method of determining the Include path for .RC file c' + 24 | 'ompilation' 25 | ExplicitWidth = 257 26 | end 27 | end 28 | object vstIncludePackages: TVirtualStringTree 29 | Left = 31 30 | Top = 83 31 | Width = 231 32 | Height = 109 33 | Anchors = [akLeft, akTop, akRight, akBottom] 34 | Header.AutoSizeIndex = 0 35 | Header.Options = [hoAutoResize, hoColumnResize, hoDrag] 36 | NodeDataSize = 4 37 | TabOrder = 2 38 | TreeOptions.MiscOptions = [toAcceptOLEDrop, toCheckSupport, toFullRepaintOnResize, toInitOnSave, toToggleOnDblClick, toWheelPanning] 39 | TreeOptions.PaintOptions = [toShowDropmark, toThemeAware, toUseBlendedImages] 40 | OnChecked = vstIncludePackagesChecked 41 | OnGetText = vstIncludePackagesGetText 42 | OnInitNode = vstIncludePackagesInitNode 43 | Columns = < 44 | item 45 | Position = 0 46 | Width = 231 47 | WideText = 'Include Header Packages' 48 | end> 49 | end 50 | object RadioButtonCustomIncludePath: TRadioButton 51 | Left = 16 52 | Top = 235 53 | Width = 177 54 | Height = 17 55 | Anchors = [akLeft, akBottom] 56 | Caption = 'Use a Custo&m Include Path' 57 | TabOrder = 4 58 | OnClick = RadioButtonCustomIncludePathClick 59 | end 60 | object EditCustomIncludePath: TEdit 61 | Left = 32 62 | Top = 258 63 | Width = 203 64 | Height = 21 65 | Anchors = [akLeft, akRight, akBottom] 66 | TabOrder = 5 67 | end 68 | object ButtonCustomIncludePath: TButton 69 | Left = 241 70 | Top = 254 71 | Width = 21 72 | Height = 21 73 | Anchors = [akRight, akBottom] 74 | Caption = '...' 75 | TabOrder = 6 76 | end 77 | object RadioButtonCompilerIncludePath: TRadioButton 78 | Left = 16 79 | Top = 60 80 | Width = 177 81 | Height = 17 82 | Caption = 'Use the &Compiler Include Path' 83 | TabOrder = 1 84 | OnClick = RadioButtonCustomIncludePathClick 85 | end 86 | object RadioButtonEnvironmentVariableIncludePath: TRadioButton 87 | Left = 16 88 | Top = 203 89 | Width = 209 90 | Height = 17 91 | Anchors = [akLeft, akBottom] 92 | Caption = 'Use the '#39'Include'#39' Environment Variable' 93 | TabOrder = 3 94 | OnClick = RadioButtonCustomIncludePathClick 95 | end 96 | end 97 | -------------------------------------------------------------------------------- /Source/RawResourceForm.dfm: -------------------------------------------------------------------------------- 1 | inherited FormRawResource: TFormRawResource 2 | Left = 216 3 | Top = 221 4 | ActiveControl = HexDump 5 | Caption = 'FormRawResource' 6 | PixelsPerInch = 96 7 | TextHeight = 13 8 | object HexDump: THexDump 9 | Left = 0 10 | Top = 0 11 | Width = 701 12 | Height = 455 13 | Align = alClient 14 | Border = bsSingle 15 | Color = clWhite 16 | UseDockManager = False 17 | Font.Charset = ANSI_CHARSET 18 | Font.Color = clWindowText 19 | Font.Height = -13 20 | Font.Name = 'Courier New' 21 | Font.Style = [] 22 | ParentBackground = False 23 | ParentColor = False 24 | ParentFont = False 25 | TabOrder = 0 26 | ReadOnly = False 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /Source/RawResourceForm.pas: -------------------------------------------------------------------------------- 1 | unit RawResourceForm; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 | ResourceForm, ComponentHexDump, unitResourceDetails; 8 | 9 | type 10 | TFormRawResource = class(TFormResource) 11 | HexDump: THexDump; 12 | protected 13 | procedure SetObject(const Value: TObject); override; 14 | end; 15 | 16 | implementation 17 | 18 | {$R *.DFM} 19 | 20 | { TfmRawResource } 21 | 22 | procedure TFormRawResource.SetObject(const Value: TObject); 23 | var 24 | Details: TResourceDetails; 25 | begin 26 | inherited; 27 | 28 | Details := obj as TResourceDetails; 29 | 30 | HexDump.Address := Details.Data.Memory; 31 | HexDump.DataSize := Details.Data.Size 32 | end; 33 | 34 | end. 35 | -------------------------------------------------------------------------------- /Source/ResourceForm.dfm: -------------------------------------------------------------------------------- 1 | inherited FormResource: TFormResource 2 | Left = 247 3 | Top = 156 4 | Caption = 'Resource' 5 | OldCreateOrder = True 6 | PixelsPerInch = 96 7 | TextHeight = 13 8 | end 9 | -------------------------------------------------------------------------------- /Source/ResourceObjectForm.dfm: -------------------------------------------------------------------------------- 1 | object FormResourceObject: TFormResourceObject 2 | Left = 209 3 | Top = 103 4 | Align = alClient 5 | BorderStyle = bsNone 6 | Caption = 'Resource Object' 7 | ClientHeight = 455 8 | ClientWidth = 701 9 | Color = clBtnFace 10 | Font.Charset = DEFAULT_CHARSET 11 | Font.Color = clWindowText 12 | Font.Height = -11 13 | Font.Name = 'MS Sans Serif' 14 | Font.Style = [] 15 | OldCreateOrder = False 16 | Scaled = False 17 | OnClose = FormClose 18 | OnDestroy = FormDestroy 19 | PixelsPerInch = 96 20 | TextHeight = 13 21 | end 22 | -------------------------------------------------------------------------------- /Source/ResourceObjectForm.pas: -------------------------------------------------------------------------------- 1 | (*======================================================================* 2 | | ResourceObjectForm | 3 | | | 4 | | Ultimate ancestor of object editor forms. Note that resource | 5 | | editor forms are derived from TFormResource, which is derived | 6 | | from this form. | 7 | | | 8 | | * Gold code. | 9 | | | 10 | | Version Date By Description | 11 | | ------- ---------- ---- ------------------------------------------| 12 | | 1.0 06/02/2001 CPWW Original | 13 | *======================================================================*) 14 | 15 | unit ResourceObjectForm; 16 | 17 | interface 18 | 19 | uses 20 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 21 | Menus, unitResourceDetails; 22 | 23 | type 24 | //======================================================================= 25 | // TFormResourceObject class 26 | 27 | TFormResourceObject = class(TForm) 28 | procedure FormClose(Sender: TObject; var Action: TCloseAction); 29 | procedure FormDestroy(Sender: TObject); 30 | private 31 | FObject: TObject; 32 | FResourceModule: TResourceModule; 33 | protected 34 | procedure SetObject(const Value: TObject); virtual; 35 | function GetMenuItem: TMenuItem; virtual; 36 | public 37 | procedure PreviewKey(var key: Word; shift: TShiftState); virtual; 38 | procedure TidyUp; virtual; 39 | procedure UpdateFonts; virtual; 40 | 41 | property ResourceModule: TResourceModule read FResourceModule write FResourceModule; 42 | property Obj: TObject read FObject write SetObject; 43 | property Menu: TMenuItem read GetMenuItem; 44 | end; 45 | 46 | TResourceObjectFormClass = class of TFormResourceObject; 47 | 48 | var 49 | fmResourceObject: TFormResourceObject; 50 | 51 | implementation 52 | 53 | {$R *.DFM} 54 | 55 | { TFormResourceObject } 56 | 57 | (*----------------------------------------------------------------------* 58 | | TFormResourceObject.SetObject | 59 | | | 60 | | 'Set' method for the 'Object' property | 61 | *----------------------------------------------------------------------*) 62 | procedure TFormResourceObject.SetObject(const Value: TObject); 63 | begin 64 | FObject := Value; 65 | UpdateFonts; 66 | end; 67 | 68 | (*----------------------------------------------------------------------* 69 | | TFormResourceObject.FormClose | 70 | | | 71 | | OnClose handler for the form. Auto-free. | 72 | *----------------------------------------------------------------------*) 73 | procedure TFormResourceObject.FormClose(Sender: TObject; var Action: TCloseAction); 74 | begin 75 | Action := caFree; 76 | end; 77 | 78 | (*----------------------------------------------------------------------* 79 | | TFormResourceObject.FormDestroy | 80 | | | 81 | | OnDestroy handler for the form. Set the fmresourceObject global | 82 | | variable to Nil | 83 | *----------------------------------------------------------------------*) 84 | procedure TFormResourceObject.FormDestroy(Sender: TObject); 85 | begin 86 | fmResourceObject := nil 87 | end; 88 | 89 | (*----------------------------------------------------------------------* 90 | | TFormResourceObject.GetMenuItem | 91 | | | 92 | | Stub function for editor forms that have a main menu item. | 93 | *----------------------------------------------------------------------*) 94 | function TFormResourceObject.GetMenuItem: TMenuItem; 95 | begin 96 | Result := nil 97 | end; 98 | 99 | procedure TFormResourceObject.PreviewKey(var key: Word; shift: TShiftState); 100 | begin 101 | 102 | end; 103 | 104 | procedure TFormResourceObject.TidyUp; 105 | begin 106 | // 107 | end; 108 | 109 | procedure TFormResourceObject.UpdateFonts; 110 | begin 111 | // Stub 112 | end; 113 | 114 | end. 115 | -------------------------------------------------------------------------------- /Source/ResourcePropertiesDialog.dfm: -------------------------------------------------------------------------------- 1 | object dlgResourceProperties: TdlgResourceProperties 2 | Left = 199 3 | Top = 124 4 | Caption = 'Resource Properties' 5 | ClientHeight = 134 6 | ClientWidth = 304 7 | Color = clBtnFace 8 | Constraints.MaxHeight = 161 9 | Constraints.MinHeight = 161 10 | Constraints.MinWidth = 252 11 | Font.Charset = DEFAULT_CHARSET 12 | Font.Color = clWindowText 13 | Font.Height = -11 14 | Font.Name = 'MS Sans Serif' 15 | Font.Style = [] 16 | OldCreateOrder = False 17 | Position = poMainFormCenter 18 | OnShow = FormShow 19 | DesignSize = ( 20 | 304 21 | 134) 22 | PixelsPerInch = 96 23 | TextHeight = 13 24 | object LabelName: TLabel 25 | Left = 16 26 | Top = 16 27 | Width = 28 28 | Height = 13 29 | Caption = '&Name' 30 | end 31 | object LabelLanguage: TLabel 32 | Left = 16 33 | Top = 56 34 | Width = 48 35 | Height = 13 36 | Caption = '&Language' 37 | FocusControl = ComboBoxLanguage 38 | end 39 | object ComboBoxLanguage: TComboBox 40 | Left = 80 41 | Top = 52 42 | Width = 213 43 | Height = 21 44 | Anchors = [akLeft, akTop, akRight] 45 | Sorted = True 46 | TabOrder = 1 47 | end 48 | object ButtonOK: TButton 49 | Left = 140 50 | Top = 94 51 | Width = 75 52 | Height = 25 53 | Anchors = [akRight, akBottom] 54 | Caption = 'OK' 55 | Default = True 56 | ModalResult = 1 57 | TabOrder = 2 58 | end 59 | object ButtonCancel: TButton 60 | Left = 218 61 | Top = 94 62 | Width = 75 63 | Height = 25 64 | Anchors = [akRight, akBottom] 65 | Cancel = True 66 | Caption = 'Cancel' 67 | ModalResult = 2 68 | TabOrder = 3 69 | end 70 | object EditName: TEdit 71 | Left = 80 72 | Top = 12 73 | Width = 209 74 | Height = 21 75 | Anchors = [akLeft, akTop, akRight] 76 | TabOrder = 0 77 | end 78 | end 79 | -------------------------------------------------------------------------------- /Source/ResourcePropertiesDialog.pas: -------------------------------------------------------------------------------- 1 | unit ResourcePropertiesDialog; 2 | 3 | {$WARN SYMBOL_PLATFORM OFF} 4 | 5 | interface 6 | 7 | uses 8 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 9 | StdCtrls, unitResourceDetails; 10 | 11 | type 12 | TdlgResourceProperties = class(TForm) 13 | LabelName: TLabel; 14 | LabelLanguage: TLabel; 15 | ComboBoxLanguage: TComboBox; 16 | ButtonOK: TButton; 17 | ButtonCancel: TButton; 18 | EditName: TEdit; 19 | procedure FormShow(Sender: TObject); 20 | private 21 | function GetLanguage: LCID; 22 | public 23 | ResourceDetails: TResourceDetails; 24 | 25 | property Language: LCID read GetLanguage; 26 | end; 27 | 28 | implementation 29 | 30 | {$R *.DFM} 31 | 32 | uses 33 | unitResourceMessages, ResourceForm; 34 | 35 | resourcestring 36 | rstNeutral = 'Language Neutral'; 37 | 38 | procedure TdlgResourceProperties.FormShow(Sender: TObject); 39 | var 40 | i: Integer; 41 | def: string; 42 | begin 43 | UseInternationalFont(EditName.Font); 44 | if Assigned(ResourceDetails) then 45 | begin 46 | if ResourceDetails is TStringResourceDetails then 47 | EditName.Text := ResIdToStringsId (ResourceDetails.ResourceName) 48 | else 49 | EditName.Text := ResourceDetails.ResourceName; 50 | end; 51 | 52 | ComboBoxLanguage.Items.Add ('- ' + rstNeutral); 53 | def := '-'; 54 | 55 | for i := 0 to Languages.Count - 1 do 56 | begin 57 | ComboBoxLanguage.Items.Add(Languages.Name[i]); 58 | if Assigned(ResourceDetails) and (ResourceDetails.ResourceLanguage <> 0) and (DWORD (ResourceDetails.ResourceLanguage) = Languages.LocaleID [i]) then 59 | def := Languages.Name[i]; 60 | end; 61 | 62 | if def = '-' then 63 | ComboBoxLanguage.ItemIndex := 0 64 | else 65 | ComboBoxLanguage.Text := def; 66 | end; 67 | 68 | function TdlgResourceProperties.GetLanguage: LCID; 69 | var 70 | i: Integer; 71 | begin 72 | Result := 0; 73 | if ComboBoxLanguage.ItemIndex <> 0 then 74 | for i := 0 to Languages.Count - 1 do 75 | if Languages.Name [i] = ComboBoxLanguage.Text then 76 | begin 77 | Result := Languages.LocaleID[i]; 78 | break 79 | end 80 | end; 81 | 82 | end. 83 | -------------------------------------------------------------------------------- /Source/TextResourceForm.dfm: -------------------------------------------------------------------------------- 1 | inherited FormTextResource: TFormTextResource 2 | Caption = 'FormTextResource' 3 | OnCreate = FormCreate 4 | OnShow = FormShow 5 | PixelsPerInch = 96 6 | TextHeight = 13 7 | object vstStrings: TVirtualStringTree 8 | Left = 0 9 | Top = 0 10 | Width = 701 11 | Height = 455 12 | Align = alClient 13 | Header.AutoSizeIndex = 1 14 | Header.Options = [hoAutoResize, hoColumnResize, hoDrag, hoVisible] 15 | Header.Style = hsPlates 16 | PopupMenu = PopupMenuStrings 17 | TabOrder = 1 18 | TreeOptions.MiscOptions = [toAcceptOLEDrop, toEditable, toFullRepaintOnResize, toInitOnSave, toToggleOnDblClick, toWheelPanning] 19 | TreeOptions.PaintOptions = [toShowDropmark, toShowHorzGridLines, toShowVertGridLines, toThemeAware, toUseBlendedImages, toFullVertGridLines] 20 | TreeOptions.SelectionOptions = [toFullRowSelect, toRightClickSelect] 21 | OnDblClick = vstStringsDblClick 22 | OnEditing = vstStringsEditing 23 | OnGetText = vstStringsGetText 24 | OnKeyDown = vstStringsKeyDown 25 | OnNewText = vstStringsNewText 26 | Columns = < 27 | item 28 | Options = [coDraggable, coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible] 29 | Position = 0 30 | Width = 100 31 | WideText = 'Id' 32 | end 33 | item 34 | Options = [coDraggable, coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible] 35 | Position = 1 36 | Width = 597 37 | WideText = 'String' 38 | end> 39 | end 40 | object mmoMessage: TExRichEdit 41 | Left = 0 42 | Top = 40 43 | Width = 185 44 | Height = 73 45 | Text = 'mmoMessage' 46 | RightMargin = 0 47 | AutoURLDetect = False 48 | AutoURLExecute = False 49 | Font.Charset = ANSI_CHARSET 50 | Font.Color = clWindowText 51 | Font.Height = -11 52 | Font.Name = 'MS Sans Serif' 53 | Font.Style = [] 54 | ParentFont = False 55 | TabOrder = 0 56 | Visible = False 57 | OnExit = mmoMessageExit 58 | end 59 | object MainMenuStrings: TMainMenu 60 | Left = 648 61 | Top = 32 62 | object MenuItemStrings: TMenuItem 63 | Caption = '&Strings' 64 | object MenuItemAddString: TMenuItem 65 | Action = ActionStringsAdd 66 | end 67 | object MenuItemModifyString: TMenuItem 68 | Action = ActionStringsModify 69 | end 70 | object MenuItemDeleteString: TMenuItem 71 | Action = ActionStringsDelete 72 | end 73 | object MenuItemChangeID: TMenuItem 74 | Action = ActionStringsChangeID 75 | end 76 | end 77 | end 78 | object ActionList: TActionList 79 | Left = 648 80 | Top = 72 81 | object ActionStringsAdd: TAction 82 | Category = 'Strings' 83 | Caption = '&Add String' 84 | ShortCut = 45 85 | OnExecute = ActionStringsAddExecute 86 | end 87 | object ActionStringsModify: TAction 88 | Category = 'Strings' 89 | Caption = '&Modify String' 90 | OnExecute = ActionStringsModifyExecute 91 | end 92 | object ActionStringsDelete: TAction 93 | Category = 'Strings' 94 | Caption = '&Delete String' 95 | ShortCut = 46 96 | OnExecute = ActionStringsDeleteExecute 97 | end 98 | object ActionStringsChangeID: TAction 99 | Category = 'Strings' 100 | Caption = '&Change ID' 101 | OnExecute = ActionStringsChangeIDExecute 102 | end 103 | end 104 | object PopupMenuStrings: TPopupMenu 105 | Left = 648 106 | Top = 120 107 | object MenuItemAddString2: TMenuItem 108 | Action = ActionStringsAdd 109 | end 110 | object MenuItemModifyString2: TMenuItem 111 | Action = ActionStringsModify 112 | end 113 | object MenuItemDeleteString2: TMenuItem 114 | Action = ActionStringsDelete 115 | end 116 | object MenuItemChangeID2: TMenuItem 117 | Action = ActionStringsChangeID 118 | end 119 | end 120 | end 121 | -------------------------------------------------------------------------------- /Source/VersionResourceForm.dfm: -------------------------------------------------------------------------------- 1 | inherited FormVersionResource: TFormVersionResource 2 | Left = 174 3 | Top = 116 4 | ActiveControl = PropertyListBox 5 | Caption = 'FormVersionResource' 6 | ClientHeight = 432 7 | ClientWidth = 777 8 | Menu = MainMenu 9 | OnResize = FormResize 10 | ExplicitWidth = 777 11 | ExplicitHeight = 451 12 | PixelsPerInch = 96 13 | TextHeight = 13 14 | object Splitter: TSplitter 15 | Left = 201 16 | Top = 0 17 | Height = 432 18 | end 19 | object ListViewVersionStrings: TListView 20 | Left = 204 21 | Top = 0 22 | Width = 573 23 | Height = 432 24 | Align = alClient 25 | Columns = < 26 | item 27 | Caption = 'Name' 28 | Width = 200 29 | end 30 | item 31 | AutoSize = True 32 | Caption = 'Value' 33 | end> 34 | ColumnClick = False 35 | GridLines = True 36 | RowSelect = True 37 | PopupMenu = PopupMenu 38 | TabOrder = 1 39 | ViewStyle = vsReport 40 | OnDblClick = ListViewVersionStringsDblClick 41 | OnEdited = ListViewVersionStringsEdited 42 | end 43 | object PanelStrings: TPanel 44 | Left = 0 45 | Top = 0 46 | Width = 201 47 | Height = 432 48 | Align = alLeft 49 | BevelOuter = bvLowered 50 | FullRepaint = False 51 | TabOrder = 0 52 | object PropertyListBox: TPropertyListBox 53 | Left = 1 54 | Top = 1 55 | Width = 199 56 | Height = 430 57 | VertScrollBar.Increment = 17 58 | VertScrollBar.Range = 136 59 | Align = alClient 60 | BorderStyle = bsNone 61 | TabOrder = 0 62 | TabStop = False 63 | Properties = < 64 | item 65 | PropertyName = 'Product Version' 66 | PropertyType = ptString 67 | Tag = 0 68 | ParentColor = False 69 | Color = clBlack 70 | ReadOnly = False 71 | end 72 | item 73 | PropertyName = 'File Version' 74 | PropertyType = ptString 75 | Tag = 0 76 | ParentColor = False 77 | Color = clBlack 78 | ReadOnly = False 79 | end 80 | item 81 | PropertyName = 'Debug' 82 | PropertyType = ptBoolean 83 | Tag = 0 84 | ParentColor = False 85 | Color = clBlack 86 | ReadOnly = False 87 | end 88 | item 89 | PropertyName = 'Inferred' 90 | PropertyType = ptBoolean 91 | Tag = 0 92 | ParentColor = False 93 | Color = clBlack 94 | ReadOnly = False 95 | end 96 | item 97 | PropertyName = 'Patched' 98 | PropertyType = ptBoolean 99 | Tag = 0 100 | ParentColor = False 101 | Color = clBlack 102 | ReadOnly = False 103 | end 104 | item 105 | PropertyName = 'Pre Release' 106 | PropertyType = ptBoolean 107 | Tag = 0 108 | ParentColor = False 109 | Color = clBlack 110 | ReadOnly = False 111 | end 112 | item 113 | PropertyName = 'Private Build' 114 | PropertyType = ptBoolean 115 | Tag = 0 116 | ParentColor = False 117 | Color = clBlack 118 | ReadOnly = False 119 | end 120 | item 121 | PropertyName = 'Special Build' 122 | PropertyType = ptBoolean 123 | Tag = 0 124 | ParentColor = False 125 | Color = clBlack 126 | ReadOnly = False 127 | end> 128 | ActualValueColWidth = 0 129 | OnPropertyChanged = PropertyListBoxPropertyChanged 130 | end 131 | end 132 | object mmoMessage: TExRichEdit 133 | Left = 408 134 | Top = 80 135 | Width = 185 136 | Height = 73 137 | Text = 'mmoMessage' 138 | RightMargin = 0 139 | AutoURLDetect = False 140 | AutoURLExecute = False 141 | Enabled = False 142 | Font.Charset = ANSI_CHARSET 143 | Font.Color = clWindowText 144 | Font.Height = -11 145 | Font.Name = 'MS Sans Serif' 146 | Font.Style = [] 147 | ParentFont = False 148 | TabOrder = 2 149 | Visible = False 150 | OnExit = mmoMessageExit 151 | end 152 | object MainMenu: TMainMenu 153 | Left = 728 154 | Top = 32 155 | object MenuItemStrings: TMenuItem 156 | Caption = '&Strings' 157 | GroupIndex = 27 158 | object MenuItemAddString: TMenuItem 159 | Action = ActionStringAddString 160 | end 161 | object MenuItemModifyString: TMenuItem 162 | Action = ActionStringModifyString 163 | end 164 | object MenuItemStringModifyStringName: TMenuItem 165 | Action = ActionStringModifyStringName 166 | end 167 | object MenuItemDeleteString: TMenuItem 168 | Action = ActionStringDeleteString 169 | end 170 | end 171 | end 172 | object ActionList: TActionList 173 | Left = 728 174 | Top = 64 175 | object ActionStringAddString: TAction 176 | Category = 'Strings' 177 | Caption = '&Add String' 178 | ShortCut = 45 179 | OnExecute = ActionStringAddStringExecute 180 | end 181 | object ActionStringModifyString: TAction 182 | Category = 'Strings' 183 | Caption = '&Modify String' 184 | OnExecute = ActionStringModifyStringExecute 185 | end 186 | object ActionStringDeleteString: TAction 187 | Category = 'Strings' 188 | Caption = '&Delete String' 189 | ShortCut = 46 190 | OnExecute = ActionStringDeleteStringExecute 191 | end 192 | object ActionStringModifyStringName: TAction 193 | Category = 'Strings' 194 | Caption = 'Modify String &Name' 195 | OnExecute = ActionStringModifyStringNameExecute 196 | end 197 | end 198 | object PopupMenu: TPopupMenu 199 | Left = 736 200 | Top = 96 201 | object MenuItemAddString2: TMenuItem 202 | Action = ActionStringAddString 203 | end 204 | object MenuItemModifyString2: TMenuItem 205 | Action = ActionStringModifyString 206 | end 207 | object MenuItemModifyStringName: TMenuItem 208 | Action = ActionStringModifyStringName 209 | end 210 | object MenuItemDeleteString2: TMenuItem 211 | Action = ActionStringDeleteString 212 | end 213 | end 214 | end 215 | -------------------------------------------------------------------------------- /Source/XN.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/XN.ico -------------------------------------------------------------------------------- /Source/XNResourceEditor.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/XNResourceEditor.res -------------------------------------------------------------------------------- /Source/XPManifestResourceForm.dfm: -------------------------------------------------------------------------------- 1 | inherited FormXPManifestResource: TFormXPManifestResource 2 | ActiveControl = Memo 3 | Caption = 'FormXPManifestResource' 4 | PixelsPerInch = 96 5 | TextHeight = 13 6 | object Memo: TMemo 7 | Left = 0 8 | Top = 0 9 | Width = 701 10 | Height = 455 11 | Align = alClient 12 | TabOrder = 0 13 | OnExit = MemoExit 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /Source/XPManifestResourceForm.pas: -------------------------------------------------------------------------------- 1 | unit XPManifestResourceForm; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 7 | Dialogs, ResourceForm, unitResourceXPManifests, 8 | StdCtrls; 9 | 10 | type 11 | TFormXPManifestResource = class(TFormResource) 12 | Memo: TMemo; 13 | procedure MemoExit(Sender: TObject); 14 | private 15 | FDetails : TXPManifestResourceDetails; 16 | protected 17 | function GetCanCopy: Boolean; override; 18 | function GetCanCut: Boolean; override; 19 | function GetCanPaste: Boolean; override; 20 | function GetCanSelectAll : Boolean; override; 21 | function GetCanDelete: Boolean; override; 22 | 23 | public 24 | procedure SetObject(const Value: TObject); override; 25 | procedure Cut; override; 26 | procedure Copy; override; 27 | procedure Paste; override; 28 | procedure SelectAll; override; 29 | procedure EditDelete; override; 30 | end; 31 | 32 | implementation 33 | 34 | {$R *.dfm} 35 | 36 | resourcestring 37 | rstChangeManifest = 'change manifest'; 38 | 39 | { TfmXPManifestResource } 40 | 41 | procedure TFormXPManifestResource.Copy; 42 | begin 43 | Memo.CopyToClipboard; 44 | end; 45 | 46 | procedure TFormXPManifestResource.Cut; 47 | begin 48 | Memo.CutToClipboard; 49 | end; 50 | 51 | procedure TFormXPManifestResource.EditDelete; 52 | begin 53 | Memo.SetSelTextBuf(''); 54 | end; 55 | 56 | function TFormXPManifestResource.GetCanCopy: Boolean; 57 | begin 58 | Result := Memo.SelLength > 0; 59 | end; 60 | 61 | function TFormXPManifestResource.GetCanCut: Boolean; 62 | begin 63 | Result := Memo.SelLength > 0; 64 | end; 65 | 66 | function TFormXPManifestResource.GetCanDelete: Boolean; 67 | begin 68 | Result := Memo.SelLength > 0; 69 | end; 70 | 71 | function TFormXPManifestResource.GetCanPaste: Boolean; 72 | begin 73 | Result := Memo.SelLength > 0; 74 | end; 75 | 76 | function TFormXPManifestResource.GetCanSelectAll: Boolean; 77 | begin 78 | Result := Memo.SelLength > 0; 79 | end; 80 | 81 | procedure TFormXPManifestResource.Paste; 82 | begin 83 | Memo.PasteFromClipboard; 84 | end; 85 | 86 | procedure TFormXPManifestResource.SelectAll; 87 | begin 88 | Memo.SelectAll; 89 | end; 90 | 91 | procedure TFormXPManifestResource.SetObject(const Value: TObject); 92 | begin 93 | inherited; 94 | 95 | FDetails := obj as TXPManifestResourceDetails; 96 | Memo.Lines.Text := FDetails.Text; 97 | end; 98 | 99 | procedure TFormXPManifestResource.MemoExit(Sender: TObject); 100 | begin 101 | if Memo.CanUndo then 102 | begin 103 | AddUndoEntry(rstChangeManifest); 104 | FDetails.Text := Memo.Lines.Text; 105 | end; 106 | end; 107 | 108 | end. 109 | -------------------------------------------------------------------------------- /Source/grad.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/grad.res -------------------------------------------------------------------------------- /Source/i.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefansundin/xn_resource_editor/0fb1cb7753d081e6d47a8efa3ef0edc31d718cda/Source/i.res -------------------------------------------------------------------------------- /Source/unitIncludePathPackages.pas: -------------------------------------------------------------------------------- 1 | unit unitIncludePathPackages; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Classes, SysUtils, ShFolder, unitIncludePaths; 7 | 8 | type 9 | 10 | TBCB5IncludePathPackage = class (TIncludePathPackage) 11 | protected 12 | function GetRootDirectory : string; override; 13 | function GetName : string; override; 14 | end; 15 | 16 | TBCB6IncludePathPackage = class (TIncludePathPackage) 17 | protected 18 | function GetRootDirectory : string; override; 19 | function GetName : string; override; 20 | end; 21 | 22 | TBDS4IncludePathPackage = class (TIncludePathPackage) 23 | protected 24 | function GetRootDirectory : string; override; 25 | function GetName : string; override; 26 | end; 27 | 28 | TVsIncludePathPackage = class (TIncludePathPackage) 29 | protected 30 | function GetRootDirectory : string; override; 31 | function GetName : string; override; 32 | function GetIncludePath: string; override; 33 | end; 34 | 35 | TMSDotNetIncludePathPackage = class (TIncludePathPackage) 36 | protected 37 | function GetRootDirectory : string; override; 38 | function GetName : string; override; 39 | function GetIncludePath: string; override; 40 | end; 41 | 42 | TMSDotNet2003IncludePathPackage = class (TMSDotNetIncludePathPackage) 43 | function GetRootDirectory : string; override; 44 | function GetName : string; override; 45 | function GetIncludePath: string; override; 46 | end; 47 | 48 | implementation 49 | 50 | uses 51 | Registry; 52 | 53 | function ProgramFilesPath : string; 54 | const 55 | SHGFP_TYPE_CURRENT = 0; 56 | SHGFP_TYPE_DEFAULT = 1; 57 | begin 58 | SetLength(Result, MAX_PATH + 1); 59 | if Succeeded (ShGetFolderPath(0, CSIDL_PROGRAM_FILES, 0, SHGFP_TYPE_CURRENT, PChar (Result))) then 60 | Result := PChar (Result) 61 | else 62 | Result := 'c:\Program Files' 63 | end; 64 | 65 | function GetPathFromHKLM (const key, value : string) : string; 66 | var 67 | reg : TRegistry; 68 | begin 69 | Result := ''; 70 | reg := TRegistry.Create(KEY_READ); 71 | try 72 | reg.RootKey := HKEY_LOCAL_MACHINE; 73 | if reg.OpenKey(key, false) then 74 | begin 75 | Result := reg.ReadString(value); 76 | if (Result <> '') and (Result [Length(Result)] = '\') then 77 | Delete(Result, Length(Result), 1) 78 | end 79 | finally 80 | reg.Free 81 | end 82 | end; 83 | 84 | { TBCB5IncludePathPackage } 85 | 86 | function TBCB5IncludePathPackage.GetName: string; 87 | begin 88 | Result := 'Borland C++ Builder 5.0'; 89 | end; 90 | 91 | function TBCB5IncludePathPackage.GetRootDirectory: string; 92 | begin 93 | Result := ProgramFilesPath + '\Borland\CBuilder5'; 94 | end; 95 | 96 | { TBCB6IncludePathPackage } 97 | 98 | function TBCB6IncludePathPackage.GetName: string; 99 | begin 100 | Result := 'Borland C++ Builder 6.0'; 101 | end; 102 | 103 | function TBCB6IncludePathPackage.GetRootDirectory: string; 104 | begin 105 | Result := ProgramFilesPath + '\Borland\CBuilder6'; 106 | end; 107 | 108 | { TBDS4IncludePathPackage } 109 | 110 | function TBDS4IncludePathPackage.GetName: string; 111 | begin 112 | Result := 'Borland Developer Studio 2006'; 113 | end; 114 | 115 | function TBDS4IncludePathPackage.GetRootDirectory: string; 116 | begin 117 | Result := GetPathFromHKLM ('Software\Borland\BDS\4.0', 'RootDir'); 118 | end; 119 | 120 | { TVsIncludePathPackage } 121 | 122 | function TVsIncludePathPackage.GetIncludePath: string; 123 | begin 124 | Result := inherited GetIncludePath; 125 | Result := Result + ';' + GetRootDirectory + '\MFC\Include'; 126 | end; 127 | 128 | function TVsIncludePathPackage.GetName: string; 129 | begin 130 | Result := 'Microsoft Visual Studio C++ 6.0'; 131 | end; 132 | 133 | function TVsIncludePathPackage.GetRootDirectory: string; 134 | begin 135 | Result := GetPathFromHKLM ('Software\Microsoft\VisualStudio\6.0\Setup\Microsoft Visual C++', 'ProductDir'); 136 | end; 137 | 138 | { TMSDotNetIncludePathPackage } 139 | 140 | function TMSDotNetIncludePathPackage.GetIncludePath: string; 141 | var 142 | rootDir : string; 143 | frameworkDir : string; 144 | begin 145 | Result := GetPathFromHKLM ('Software\Microsoft\VisualStudio\7.0\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories', 'Include Dirs'); 146 | rootDir := GetRootDirectory + '\'; 147 | frameworkDir := ProgramFilesPath + '\Microsoft.net\sdk\'; 148 | 149 | Result := StringReplace(Result, '$(VCInstallDir)', rootDir, [rfReplaceAll, rfIgnoreCase]); 150 | Result := StringReplace(Result, '$(FrameworkSDKDir)', frameworkDir, [rfReplaceAll, rfIgnoreCase]); 151 | end; 152 | 153 | function TMSDotNetIncludePathPackage.GetName: string; 154 | begin 155 | Result := 'Microsoft Visual Studio .Net C++'; 156 | end; 157 | 158 | function TMSDotNetIncludePathPackage.GetRootDirectory: string; 159 | begin 160 | Result := GetPathFromHKLM ('Software\Microsoft\VisualStudio\7.0\Setup\VC', 'ProductDir'); 161 | end; 162 | 163 | { TMSDotNet2003IncludePathPackage } 164 | 165 | function TMSDotNet2003IncludePathPackage.GetIncludePath: string; 166 | var 167 | rootDir : string; 168 | frameworkDir : string; 169 | begin 170 | Result := GetPathFromHKLM ('Software\Microsoft\VisualStudio\7.1\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories', 'Include Dirs'); 171 | rootDir := GetRootDirectory + '\'; 172 | frameworkDir := ProgramFilesPath + '\Microsoft.net\sdk\'; 173 | 174 | Result := StringReplace(Result, '$(VCInstallDir)', rootDir, [rfReplaceAll, rfIgnoreCase]); 175 | Result := StringReplace(Result, '$(FrameworkSDKDir)', frameworkDir, [rfReplaceAll, rfIgnoreCase]); 176 | end; 177 | 178 | function TMSDotNet2003IncludePathPackage.GetName: string; 179 | begin 180 | Result := 'Microsoft Visual Studio .Net 2003 C++'; 181 | end; 182 | 183 | function TMSDotNet2003IncludePathPackage.GetRootDirectory: string; 184 | begin 185 | Result := GetPathFromHKLM ('Software\Microsoft\VisualStudio\7.1\Setup\VC', 'ProductDir'); 186 | end; 187 | 188 | begin 189 | RegisterIncludePathPackage('BCB5', TBCB5IncludePathPackage); 190 | RegisterIncludePathPackage('BCB6', TBCB6IncludePathPackage); 191 | RegisterIncludePathPackage('BDS4', TBDS4IncludePathPackage); 192 | RegisterIncludePathPackage('MSVC6', TVsIncludePathPackage); 193 | RegisterIncludePathPackage('MSVC7', TMSDotNetIncludePathPackage); 194 | RegisterIncludePathPackage('MSVC71', TMSDotNet2003IncludePathPackage); 195 | end. 196 | -------------------------------------------------------------------------------- /Source/unitIncludePaths.pas: -------------------------------------------------------------------------------- 1 | unit unitIncludePaths; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Classes, SysUtils, Contnrs; 7 | 8 | type 9 | TIncludePathPackage = class 10 | protected 11 | function GetRootDirectory : string; virtual; abstract; 12 | function GetInstalled: Boolean; virtual; 13 | function GetIncludePath: string; virtual; 14 | function GetName: string; virtual; 15 | public 16 | property Installed : Boolean read GetInstalled; 17 | property IncludePath : string read GetIncludePath; 18 | property Name : string read GetName; 19 | end; 20 | 21 | TIncludePathPackageClass = class of TIncludePathPackage; 22 | 23 | TIncludePathPackages = class 24 | private 25 | FIncludePathPackages : TObjectList; 26 | procedure Analyze; 27 | 28 | function GetCount: Integer; 29 | function GetPackage(idx: Integer): TIncludePathPackage; 30 | function GetIncludePath(const PackageName: string): string; 31 | function FindIncludePathPackage(const PackageName : string) : TIncludePathPackage; 32 | public 33 | property Count : Integer read GetCount; 34 | property Package [idx : Integer] : TIncludePathPackage read GetPackage; 35 | property IncludePath [const PackageName : string] : string read GetIncludePath; 36 | end; 37 | 38 | function GetIncludePathForPackage(const PackageName : string) : string; 39 | procedure RegisterIncludePathPackage(const key : string; cls : TIncludePathPackageClass); 40 | 41 | implementation 42 | 43 | uses 44 | unitObjectCache; 45 | 46 | var 47 | gRegisteredPackages : TClassStringAssociations; 48 | 49 | procedure RegisterIncludePathPackage(const key : string; cls : TIncludePathPackageClass); 50 | begin 51 | if gRegisteredPackages = Nil then 52 | gRegisteredPackages := TClassStringAssociations.Create; 53 | 54 | gRegisteredPackages.Associate(key, cls); 55 | end; 56 | 57 | function GetIncludePathForPackage(const PackageName : string) : string; 58 | var 59 | packages : TIncludePathPackages; 60 | begin 61 | packages := TIncludePathPackages.Create; 62 | Result := packages.IncludePath [PackageName] 63 | end; 64 | 65 | { TIncludePathPackages } 66 | 67 | procedure TIncludePathPackages.Analyze; 68 | var 69 | i : Integer; 70 | pckg : TIncludePathPackage; 71 | begin 72 | if FIncludePathPackages <> Nil then Exit; 73 | 74 | FIncludePathPackages := TObjectList.Create; 75 | 76 | for i := gRegisteredPackages.Count - 1 downto 0 do 77 | begin 78 | pckg := TIncludePathPackageClass (gRegisteredPackages.Classes[i]).Create; 79 | if pckg.Installed then 80 | FIncludePathPackages.Add(pckg) 81 | else 82 | pckg.Free 83 | end 84 | end; 85 | 86 | function TIncludePathPackages.FindIncludePathPackage( 87 | const PackageName: string): TIncludePathPackage; 88 | var 89 | i : Integer; 90 | begin 91 | Result := nil; 92 | for i := 0 to Count - 1 do 93 | if SameText(Package [i].Name, PackageName) then 94 | begin 95 | Result := Package [i]; 96 | break 97 | end 98 | end; 99 | 100 | function TIncludePathPackages.GetCount: Integer; 101 | begin 102 | Analyze; 103 | Result := FIncludePathPackages.Count; 104 | end; 105 | 106 | function TIncludePathPackages.GetIncludePath(const PackageName: string): string; 107 | var 108 | incl : TIncludePathPackage; 109 | begin 110 | incl := FindIncludePathPackage(PackageName); 111 | if Assigned(incl) then 112 | Result := incl.IncludePath 113 | else 114 | Result := '' 115 | end; 116 | 117 | function TIncludePathPackages.GetPackage(idx: Integer): TIncludePathPackage; 118 | begin 119 | Analyze; 120 | Result := TIncludePathPackage(FIncludePathPackages[idx]); 121 | end; 122 | 123 | { TIncludePathPackage } 124 | 125 | function TIncludePathPackage.GetIncludePath: string; 126 | begin 127 | Result := GetRootDirectory + '\Include' 128 | end; 129 | 130 | function TIncludePathPackage.GetInstalled: Boolean; 131 | begin 132 | Result := DirectoryExists (GetRootDirectory); 133 | end; 134 | 135 | function TIncludePathPackage.GetName: string; 136 | var 137 | i : Integer; 138 | begin 139 | for i := 0 to gRegisteredPackages.Count - 1 do 140 | if Self is gRegisteredPackages.Classes[i] then 141 | begin 142 | Result := gRegisteredPackages.Strings[i]; 143 | break 144 | end 145 | end; 146 | 147 | initialization 148 | 149 | finalization 150 | gRegisteredPackages.Free 151 | end. 152 | --------------------------------------------------------------------------------