diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2012-04-04 22:38:51 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2012-04-04 22:38:51 +0200 |
commit | c4ca437a3318d55dd5f692776b924b3ad7a558bc (patch) | |
tree | f998bbe6cae38fda36f4fa21973d524612205e6e /tools/imageconvert | |
parent | a43ab23223b5f3e7540635ca0cc3e296774340d6 (diff) | |
download | fpGUI-c4ca437a3318d55dd5f692776b924b3ad7a558bc.tar.xz |
The start of a new GUI tool to convert BMP images to Byte Array data.
Diffstat (limited to 'tools/imageconvert')
-rw-r--r-- | tools/imageconvert/frm_main.pas | 107 | ||||
-rw-r--r-- | tools/imageconvert/imgcnv.lpi | 78 | ||||
-rw-r--r-- | tools/imageconvert/imgcnv.lpr | 31 |
3 files changed, 216 insertions, 0 deletions
diff --git a/tools/imageconvert/frm_main.pas b/tools/imageconvert/frm_main.pas new file mode 100644 index 00000000..0dc3f755 --- /dev/null +++ b/tools/imageconvert/frm_main.pas @@ -0,0 +1,107 @@ +unit frm_main; + +{$mode objfpc}{$H+} + +interface + +uses + SysUtils, Classes, fpg_base, fpg_main, fpg_form, fpg_memo, fpg_menu, + fpg_button, fpg_editbtn; + +type + + TMainForm = class(TfpgForm) + private + {@VFD_HEAD_BEGIN: MainForm} + MainMenu: TfpgMenuBar; + FilenameEdit1: TfpgFileNameEdit; + memImages: TfpgMemo; + Button1: TfpgButton; + pmFile: TfpgPopupMenu; + {@VFD_HEAD_END: MainForm} + procedure miFileQuit(Sender: TObject); + public + procedure AfterCreate; override; + end; + +{@VFD_NEWFORM_DECL} + +implementation + +{@VFD_NEWFORM_IMPL} + +procedure TMainForm.miFileQuit(Sender: TObject); +begin + Close; +end; + +procedure TMainForm.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: MainForm} + Name := 'MainForm'; + SetPosition(357, 227, 484, 378); + WindowTitle := 'MainForm'; + Hint := ''; + AcceptDrops := True; + + MainMenu := TfpgMenuBar.Create(self); + with MainMenu do + begin + Name := 'MainMenu'; + SetPosition(0, 0, 484, 24); + Anchors := [anLeft,anRight,anTop]; + end; + + FilenameEdit1 := TfpgFileNameEdit.Create(self); + with FilenameEdit1 do + begin + Name := 'FilenameEdit1'; + SetPosition(4, 44, 384, 24); + ExtraHint := ''; + FileName := ''; + Filter := ''; + InitialDir := ''; + TabOrder := 3; + end; + + memImages := TfpgMemo.Create(self); + with memImages do + begin + Name := 'memImages'; + SetPosition(4, 88, 476, 286); + FontDesc := '#Edit1'; + Hint := ''; + TabOrder := 5; + end; + + Button1 := TfpgButton.Create(self); + with Button1 do + begin + Name := 'Button1'; + SetPosition(396, 44, 80, 24); + Text := 'Button'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 4; + end; + + pmFile := TfpgPopupMenu.Create(self); + with pmFile do + begin + Name := 'pmFile'; + SetPosition(236, 128, 120, 20); + AddMenuItem('Add File...', '', nil); + AddMenuItem('-', '', nil); + AddMenuItem('Quit', 'Ctrl+Q', @miFileQuit); + end; + + {@VFD_BODY_END: MainForm} + + MainMenu.AddMenuItem('File', nil).SubMenu := pmFile; + {%endregion} +end; + + +end. diff --git a/tools/imageconvert/imgcnv.lpi b/tools/imageconvert/imgcnv.lpi new file mode 100644 index 00000000..9c3c8eb9 --- /dev/null +++ b/tools/imageconvert/imgcnv.lpi @@ -0,0 +1,78 @@ +<?xml version="1.0"?> +<CONFIG> + <ProjectOptions> + <Version Value="9"/> + <General> + <Flags> + <SaveOnlyProjectUnits Value="True"/> + <MainUnitHasCreateFormStatements Value="False"/> + <MainUnitHasTitleStatement Value="False"/> + </Flags> + <SessionStorage Value="InProjectDir"/> + <MainUnit Value="0"/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <i18n> + <EnableI18N LFM="False"/> + </i18n> + <VersionInfo> + <StringTable ProductVersion=""/> + </VersionInfo> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> + <ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + <LaunchingApplication PathPlusParams="/usr/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> + </local> + </RunParams> + <RequiredPackages Count="1"> + <Item1> + <PackageName Value="fpgui_toolkit"/> + </Item1> + </RequiredPackages> + <Units Count="1"> + <Unit0> + <Filename Value="imgcnv.lpr"/> + <IsPartOfProject Value="True"/> + <UnitName Value="imgcnv"/> + </Unit0> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="9"/> + <Target> + <Filename Value="imgcnv"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Other> + <CompilerMessages> + <UseMsgFile Value="True"/> + </CompilerMessages> + <CompilerPath Value="$(CompPath)"/> + </Other> + </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/tools/imageconvert/imgcnv.lpr b/tools/imageconvert/imgcnv.lpr new file mode 100644 index 00000000..615dcd46 --- /dev/null +++ b/tools/imageconvert/imgcnv.lpr @@ -0,0 +1,31 @@ +program imgcnv; + +{$mode objfpc}{$H+} +{$ifdef mswindows}{$apptype gui}{$endif} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes, fpg_base, fpg_main, fpgui_toolkit, frm_main; + + +procedure MainProc; +var + frm: TMainForm; +begin + fpgApplication.Initialize; + frm := TMainForm.Create(nil); + try + frm.Show; + fpgApplication.Run; + finally + frm.Free; + end; +end; + +begin + MainProc; +end. + + |