diff options
author | Andrew Haines <andrewd207@aol.com> | 2010-08-15 09:22:59 -0400 |
---|---|---|
committer | Andrew Haines <andrewd207@aol.com> | 2010-08-15 09:22:59 -0400 |
commit | 917a2daf4ff769ad27631e6c71a7b919c47e4ecb (patch) | |
tree | c524983404bd70c97c17395995f962cdf41899cc /examples | |
parent | 77245bbf79e8568ba143cd7654e8aba352253a81 (diff) | |
parent | 59df247d7a5ff46cc8ac697526510b2ff6cbe5d2 (diff) | |
download | fpGUI-917a2daf4ff769ad27631e6c71a7b919c47e4ecb.tar.xz |
Merge branch 'master' of ssh://fpgui.git.sourceforge.net/gitroot/fpgui/fpgui
Diffstat (limited to 'examples')
81 files changed, 3168 insertions, 395 deletions
diff --git a/examples/apps/compileall.sh b/examples/apps/compileall.sh new file mode 100755 index 00000000..1fed112d --- /dev/null +++ b/examples/apps/compileall.sh @@ -0,0 +1,16 @@ +#!/bin/sh +FPC=fpc +for f in `find -name '*.lpr'` +do + DIR=`dirname $f` + PROJECT=`basename $f` + LPRNAME=`basename $PROJECT .lpr` + echo Doing $LPRNAME in $DIR + cd $DIR + if [ ! -d units ]; then + echo 'Missing units dir' + mkdir units + fi + $FPC @extrafpc.cfg $PROJECT; + cd .. +done diff --git a/examples/apps/debugserver/extrafpc.cfg b/examples/apps/debugserver/extrafpc.cfg new file mode 100644 index 00000000..bf32f456 --- /dev/null +++ b/examples/apps/debugserver/extrafpc.cfg @@ -0,0 +1,6 @@ +-FUunits +-Fu../../../lib/$fpctarget +-Fi. +-Xs +-XX +-CX diff --git a/examples/apps/debugserver/fpgDebugServer.lpi b/examples/apps/debugserver/fpgDebugServer.lpi new file mode 100644 index 00000000..9dff3598 --- /dev/null +++ b/examples/apps/debugserver/fpgDebugServer.lpi @@ -0,0 +1,94 @@ +<?xml version="1.0"?> +<CONFIG> + <ProjectOptions> + <Version Value="8"/> + <General> + <Flags> + <SaveOnlyProjectUnits Value="True"/> + <MainUnitHasCreateFormStatements Value="False"/> + <MainUnitHasTitleStatement Value="False"/> + <UseDefaultCompilerOptions Value="True"/> + </Flags> + <SessionStorage Value="InIDEConfig"/> + <MainUnit Value="0"/> + <TargetFileExt Value=""/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <VersionInfo> + <Language Value=""/> + <CharSet Value=""/> + <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> + </VersionInfo> + <PublishOptions> + <Version Value="2"/> + <IgnoreBinaries Value="False"/> + <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> + <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/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="2"> + <Unit0> + <Filename Value="fpgDebugServer.lpr"/> + <IsPartOfProject Value="True"/> + <UnitName Value="fpgDebugServer"/> + </Unit0> + <Unit1> + <Filename Value="frm_main.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="frm_main"/> + </Unit1> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="9"/> + <Target> + <Filename Value="fpgDebugServer"/> + </Target> + <SearchPaths> + <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Parsing> + <SyntaxOptions> + <AllowLabel Value="False"/> + <CPPInline Value="False"/> + </SyntaxOptions> + </Parsing> + <Linking> + <Options> + <Win32> + <GraphicApplication Value="True"/> + </Win32> + </Options> + </Linking> + <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/examples/apps/debugserver/fpgDebugServer.lpr b/examples/apps/debugserver/fpgDebugServer.lpr new file mode 100644 index 00000000..eaf9492b --- /dev/null +++ b/examples/apps/debugserver/fpgDebugServer.lpr @@ -0,0 +1,30 @@ +program fpgDebugServer; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes + ,fpg_main, 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. + diff --git a/examples/apps/debugserver/frm_main.pas b/examples/apps/debugserver/frm_main.pas new file mode 100644 index 00000000..e0da08a7 --- /dev/null +++ b/examples/apps/debugserver/frm_main.pas @@ -0,0 +1,467 @@ +{ + fpGUI - Free Pascal GUI Toolkit + + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this + distribution, for details of the copyright. + + See the file COPYING.modifiedLGPL, included in this distribution, + for details about redistributing fpGUI. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + Description: + This is the server part to a standard FPC unit - dbugintf. This unit + offers a simple API to send messages to a debug server (using + SimpleIPC), modeled after the GExperts GDebug tool for Delphi, with + some minor enhancements. This is a great way to debug CGI apps on a + server as well. + + NOTE: you would normally wrap the SendXXX methods with {$ifdef debug} so + the code can be excluded from a final released product (without debug + information). But this is obviously for you do decide. + + Typical usage is as follows: + + uses + dbugintf, sysutils; + + procedure BackupFile(FN : String); + var + BFN: String; + begin + SendMethodEnter('BackupFile'); + BFN := FN + '.bak'; + SendDebug(Format('backup file "%s" exists, deleting',[BFN])); + SendDebug(Format('Backing up "%s" to "%s"',[FN,BFN])); + SendMethodExit('BackupFile'); + end; + + procedure SaveToFile(FN : String); + begin + SendMethodEnter('SaveToFile'); + BackupFile(FN); + SendDebug('Saving to file '+FN); + SendMethodExit('SaveToFile'); + end; + + + Available SendXXX methods from the dbugintf unit are: + + procedure SendBoolean(const Identifier: string; const Value: Boolean); + procedure SendDateTime(const Identifier: string; const Value: TDateTime); + procedure SendInteger(const Identifier: string; const Value: Integer; HexNotation: Boolean = False); + procedure SendPointer(const Identifier: string; const Value: Pointer); + procedure SendDebugEx(const Msg: string; MType: TDebugLevel); + procedure SendDebug(const Msg: string); + procedure SendMethodEnter(const MethodName: string); + procedure SendMethodExit(const MethodName: string); + procedure SendSeparator; + procedure SendDebugFmt(const Msg: string; const Args: array of const); + procedure SendDebugFmtEx(const Msg: string; const Args: array of const; MType: TDebugLevel); + +} +unit frm_main; + +{$mode objfpc}{$H+} + +interface + +uses + SysUtils + ,Classes + ,fpg_base + ,fpg_main + ,fpg_form + ,fpg_button + ,fpg_panel + ,fpg_menu + ,fpg_basegrid + ,fpg_grid + ,simpleipc + ,dbugmsg + ; + +type + TMainForm = class(TfpgForm) + private + {@VFD_HEAD_BEGIN: MainForm} + MainMenu: TfpgMenuBar; + Bevel1: TfpgBevel; + grdMessages: TfpgStringGrid; + mnuFile: TfpgPopupMenu; + mnuEdit: TfpgPopupMenu; + mnuHelp: TfpgPopupMenu; + btnQuit: TfpgButton; + Bevel2: TfpgBevel; + btnPause: TfpgButton; + btnStart: TfpgButton; + btnClear: TfpgButton; + {@VFD_HEAD_END: MainForm} + FIPCSrv: TSimpleIPCServer; + FPaused: Boolean; + FAddAtBottom: Boolean; + FDiscarded: Integer; + FShowOnMessage: Boolean; + procedure StartServer; + procedure StopServer; + procedure CheckMessages(Sender: TObject); + procedure CheckDebugMessages; + procedure ReadDebugMessage; + procedure ShowDebugMessage(const AMsg: TDebugmessage); + procedure ShowMessageWindow; + procedure miFileQuit(Sender: TObject); + procedure miHelpAboutFPGui(Sender: TObject); + procedure miHelpProductInformation(Sender: TObject); + procedure btnClearClicked(Sender: TObject); + procedure btnPauseClicked(Sender: TObject); + procedure btnStartClicked(Sender: TObject); + procedure GridDrawCell(Sender: TObject; const ARow, ACol: Integer; const ARect: TfpgRect; const AFlags: TfpgGridDrawState; var ADefaultDrawing: boolean); + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure AfterCreate; override; + end; + +{@VFD_NEWFORM_DECL} + +implementation + +uses + dateutils + ,fpg_dialogs + ; + + +{$I images.inc} +{$I state_images.inc} + +{@VFD_NEWFORM_IMPL} + +procedure TMainForm.btnClearClicked(Sender: TObject); +begin + grdMessages.RowCount := 0; +end; + +procedure TMainForm.btnPauseClicked(Sender: TObject); +begin + FPaused := not FPaused; +end; + +procedure TMainForm.btnStartClicked(Sender: TObject); +begin + if Assigned(FIPCSrv) then + Exit; + StartServer; +end; + +procedure TMainForm.GridDrawCell(Sender: TObject; const ARow, ACol: Integer; + const ARect: TfpgRect; const AFlags: TfpgGridDrawState; var ADefaultDrawing: boolean); +var + img: TfpgImage; + i: integer; + dx: integer; +begin + if ACol = 0 then + begin + ADefaultDrawing := False; + try + i := StrToInt(grdMessages.Cells[ACol, ARow]); + case i of + -1: img := fpgImages.GetImage('dbs.state.stop'); + 0: img := fpgImages.GetImage('dbs.state.info'); + 1: img := fpgImages.GetImage('dbs.state.warning'); + 2: img := fpgImages.GetImage('dbs.state.error'); + 3: img := fpgImages.GetImage('dbs.state.identify'); + end; + dx := (grdMessages.ColumnWidth[ACol] - 16) div 2; + grdMessages.Canvas.DrawImage(ARect.Left + dx, ARect.Top {+ y}, img); + except + on E: Exception do + begin +// writeln('Cell text = ' + grdMessages.Cells[ACol, ARow]); + end; + end; + end; +end; + +procedure TMainForm.StartServer; +begin + FIPCSrv := TSimpleIPCServer.Create(nil); + FIPCSrv.ServerID := DebugServerID; + FIPCSrv.Global := True; + FIPCSrv.Active := True; + FIPCSrv.StartServer; + fpgApplication.OnIdle := @CheckMessages; +// ITMessages.Enabled:=True; +end; + +procedure TMainForm.StopServer; +begin + fpgApplication.OnIdle := nil; +// ITMessages.Enabled := False; + FreeAndNil(FIPCSrv); +end; + +procedure TMainForm.CheckMessages(Sender: TObject); +begin + CheckDebugMessages; +end; + +procedure TMainForm.CheckDebugMessages; +begin + while FIPCSrv.PeekMessage(1, True) do + ReadDebugMessage; +end; + +procedure TMainForm.ReadDebugMessage; +var + Msg: TDebugMessage; +begin + FIPCSrv.MsgData.Seek(0, soFromBeginning); + ReadDebugMessageFromStream(FIPCSrv.MsgData, MSg); + if not FPaused then + ShowDebugMessage(Msg) + else + Inc(FDiscarded); +end; + +procedure TMainForm.ShowDebugMessage(const AMsg: TDebugmessage); +var + r: integer; +begin + grdMessages.BeginUpdate; + try + grdMessages.RowCount := grdMessages.RowCount + 1; + r := grdMessages.RowCount-1; + //if FAddAtBottom then + // grdMessages.Items.Add(LI) + //else + // grdMessages.Items.InsertItem(LI, 0); + grdMessages.Cells[0, r] := IntToStr(AMsg.MsgType); + grdMessages.Cells[1, r] := FormatDateTime('HH:mm:ss', AMsg.MsgTimeStamp); + grdMessages.Cells[2, r] := AMsg.Msg; + grdMessages.FocusCol := 0; + grdMessages.FocusRow := grdMessages.RowCount-1; + finally + grdMessages.EndUpdate; + end; + if FShowOnMessage then + ShowMessageWindow; +end; + +procedure TMainForm.ShowMessageWindow; +begin + if not Visible then + Show; +end; + +procedure TMainForm.miFileQuit(Sender: TObject); +begin + Close; +end; + +procedure TMainForm.miHelpAboutFPGui(Sender: TObject); +begin + TfpgMessageDialog.AboutFPGui; +end; + +procedure TMainForm.miHelpProductInformation(Sender: TObject); +begin + TfpgMessageDialog.Information('Product Information', WindowTitle + LineEnding + 'Written by Graeme Geldenhuys - 2010'); +end; + +constructor TMainForm.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FPaused := False; + FAddAtBottom := False; + FShowOnMessage := False; + StartServer; + + fpgImages.AddMaskedBMP('dbs.clean', @DBS_clean, sizeof(DBS_clean), 15, 0); + fpgImages.AddMaskedBMP('dbs.stop', @DBS_stop, sizeof(DBS_stop), 0, 0); + fpgImages.AddMaskedBMP('dbs.pause', @DBS_pause, sizeof(DBS_pause), 0, 0); + fpgImages.AddMaskedBMP('dbs.run', @DBS_run, sizeof(DBS_run), 0, 0); + + fpgImages.AddMaskedBMP('dbs.state.info', @DBS_state_info, sizeof(DBS_state_info), 0, 0); + fpgImages.AddMaskedBMP('dbs.state.warning', @DBS_state_warning, sizeof(DBS_state_warning), 0, 0); + fpgImages.AddMaskedBMP('dbs.state.error', @DBS_state_error, sizeof(DBS_state_error), 0, 0); + fpgImages.AddMaskedBMP('dbs.state.identify', @DBS_state_lightbulb, sizeof(DBS_state_lightbulb), 0, 0); + fpgImages.AddMaskedBMP('dbs.state.stop', @DBS_state_lightbulb_off, sizeof(DBS_state_lightbulb_off), 0, 0); +end; + +destructor TMainForm.Destroy; +begin + StopServer; + inherited Destroy; +end; + +procedure TMainForm.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: MainForm} + Name := 'MainForm'; + SetPosition(353, 245, 486, 313); + WindowTitle := 'fpGUI''s Debug Server'; + Hint := ''; + ShowHint := True; + + MainMenu := TfpgMenuBar.Create(self); + with MainMenu do + begin + Name := 'MainMenu'; + SetPosition(0, 0, 486, 26); + Anchors := [anLeft,anRight,anTop]; + end; + + Bevel1 := TfpgBevel.Create(self); + with Bevel1 do + begin + Name := 'Bevel1'; + SetPosition(0, 26, 486, 31); + Anchors := [anLeft,anRight,anTop]; + Hint := ''; + Style := bsLowered; + Shape := bsBottomLine; + end; + + grdMessages := TfpgStringGrid.Create(self); + with grdMessages do + begin + Name := 'grdMessages'; + SetPosition(4, 63, 478, 246); + Anchors := [anLeft,anRight,anTop,anBottom]; + AddColumn('Type', 50, taLeftJustify); + AddColumn('Time', 75, taCenter); + AddColumn('Message', 330, taLeftJustify); + FontDesc := '#Grid'; + HeaderFontDesc := '#GridHeader'; + Hint := ''; + RowCount := 0; + RowSelect := True; + ShowGrid := False; + TabOrder := 2; + Options := [go_SmoothScroll]; + OnDrawCell := @GridDrawCell; + end; + + mnuFile := TfpgPopupMenu.Create(self); + with mnuFile do + begin + Name := 'mnuFile'; + SetPosition(260, 100, 120, 24); + AddMenuItem('Quit', '', @miFileQuit); + end; + + mnuEdit := TfpgPopupMenu.Create(self); + with mnuEdit do + begin + Name := 'mnuEdit'; + SetPosition(260, 126, 120, 24); + AddMenuItem('Cut', '', nil).Enabled := False; + AddMenuItem('Copy', '', nil).Enabled := False; + AddMenuItem('Paste', '', nil).Enabled := False; + AddMenuItem('-', '', nil); + AddMenuItem('Preferences...', '', nil).Enabled := False; + end; + + mnuHelp := TfpgPopupMenu.Create(self); + with mnuHelp do + begin + Name := 'mnuHelp'; + SetPosition(260, 152, 120, 24); + AddMenuItem('About fpGUI...', '', @miHelpAboutFPGui); + AddMenuItem('Product Information...', '', @miHelpProductInformation); + end; + + btnQuit := TfpgButton.Create(Bevel1); + with btnQuit do + begin + Name := 'btnQuit'; + SetPosition(4, 2, 25, 25); + Text := ''; + Flat := True; + FontDesc := '#Label1'; + Hint := ''; + ImageMargin := -1; + ImageName := 'stdimg.quit'; + ImageSpacing := 0; + TabOrder := 0; + Focusable := False; + OnClick := @miFileQuit; + end; + + Bevel2 := TfpgBevel.Create(Bevel1); + with Bevel2 do + begin + Name := 'Bevel2'; + SetPosition(34, 2, 8, 25); + Hint := ''; + Style := bsLowered; + Shape := bsLeftLine; + end; + + btnPause := TfpgButton.Create(Bevel1); + with btnPause do + begin + Name := 'btnPause'; + SetPosition(43, 2, 25, 25); + Text := ''; + AllowAllUp := True; + Flat := True; + FontDesc := '#Label1'; + GroupIndex := 1; + Hint := 'pause server'; + ImageMargin := -1; + ImageName := 'dbs.pause'; + TabOrder := 2; + Focusable := False; + OnClick :=@btnPauseClicked; + end; + + btnStart := TfpgButton.Create(Bevel1); + with btnStart do + begin + Name := 'btnStart'; + SetPosition(70, 2, 25, 25); + Text := ''; + Flat := True; + FontDesc := '#Label1'; + Hint := 'start server'; + ImageMargin := -1; + ImageName := 'dbs.run'; + TabOrder := 2; + Focusable := False; + OnClick := @btnStartClicked; + Enabled := False; + end; + + btnClear := TfpgButton.Create(Bevel1); + with btnClear do + begin + Name := 'btnClear'; + SetPosition(97, 2, 25, 25); + Text := ''; + Flat := True; + FontDesc := '#Label1'; + Hint := 'clear listview'; + ImageMargin := -1; + ImageName := 'dbs.clean'; + TabOrder := 2; + Focusable := False; + OnClick :=@btnClearClicked; + end; + + {@VFD_BODY_END: MainForm} + {%endregion} + + // Hook up the menus to the MenuBar + MainMenu.AddMenuItem('File', nil).SubMenu := mnuFile; + MainMenu.AddMenuItem('Edit', nil).SubMenu := mnuEdit; + MainMenu.AddMenuItem('Help', nil).SubMenu := mnuHelp; +end; + + +end. diff --git a/examples/apps/debugserver/images.inc b/examples/apps/debugserver/images.inc new file mode 100644 index 00000000..166155c9 --- /dev/null +++ b/examples/apps/debugserver/images.inc @@ -0,0 +1,208 @@ + +Const + DBS_clean : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,224, 17,243, 18,130,164, 19,130,165, 97, 87,195,222, + 18,242,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,236, 10, + 248, 29,125,169, 80,193,210, 91,211,225, 52,177,199, 17,139,164, 86, + 93,191,235, 11,247,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255, 58,110,181, 58,177, + 198, 95,216,231, 38,202,223, 78,212,229,109,217,231, 53,177,198, 25, + 127,168,217, 21,240,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,188, 37,229, 34,150,174,108,218,232, 16,197, + 220, 3,194,218, 3,194,218, 21,198,220, 91,215,231, 87,199,214, 19, + 135,165,192, 34,231,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255, 44,118,176, 94,207,221, 70,218,237, 24,208,231, 17,203, + 227, 7,196,220, 3,194,218, 3,194,218, 76,211,228, 88,205,220, 15, + 136,163,227, 15,244,255, 0,255,255, 0,255,255, 0,255,229, 14,245, + 24,143,168,139,237,251, 60,229,252, 55,228,251, 47,222,246, 35,215, + 238, 20,205,229, 4,195,219, 3,194,218, 86,214,230, 54,179,199, 87, + 94,192,255, 0,255,255, 0,255,255, 0,255,160, 47,218, 55,169,194, + 138,239,253, 95,234,253, 97,235,253, 82,233,253, 60,230,253, 42,219, + 243, 24,208,231, 16,198,220, 73,210,228,103,212,226, 23,129,167,255, + 0,255,255, 0,255,248, 4,252, 40, 30,176, 22, 65,174,132,234,251, + 107,236,253,132,239,253,109,236,253, 82,233,253, 68,229,251,101,227, + 243,119,221,235, 74,192,207, 38,151,178, 21,128,165,255, 0,255,160, + 52,218, 20,130,166, 49,159,189, 40, 74,187, 29, 56,184, 97,216,246, + 99,234,253,108,235,253,125,238,253,136,234,248, 73,186,206, 13,139, + 162, 92, 91,194,191, 35,230,253, 1,254,255, 0,255,165, 49,220, 10, + 136,161, 79,200,216,104,220,236, 51,109,200, 13, 27,171, 98,177,215, + 114,220,234, 73,183,206, 18,139,165, 97, 89,195,228, 15,245,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,126, 51,194, 1, + 135,156, 65,189,205,119,222,235, 30,102,178, 27, 48,170, 46,118,177, + 136, 65,209,234, 11,247,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,253, 1,254,106, 43,178, 12, 75,133, 11,118,178, 1, + 136,161, 51,173,190, 41,152,181,194, 33,231,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,144, 32,197, 14, 78,139, 15,122,188, 16,125,193, 14, 78,138, 49, + 107,173, 0,139,156,214, 22,239,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 18, 69, + 132, 12,114,178, 16,125,193, 10,107,169, 37, 63,142,253, 1,254,125, + 71,205,236, 10,248,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255, 26, 66,136, 10,105, + 166, 11,109,171, 10, 71,128,187, 19,219,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,196, 17,224, 37, 64,143, 28, 66, + 137,184, 20,217,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255); + +Const + DBS_run : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255, 4,115, 58, 33,130, 79, 99,130, + 114,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255, 4,115, 58,122,207,164, 44,140, 90, 61,118, + 89,174,174,174,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255, 4,115, 58,130,216,172,118,214,166, 60,157,106, 39,116, + 76,172,174,173,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 9,119, 63,131,219,174, 31,198,113,114,222,167, 75,178,127, 23,116, + 69,168,173,170,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,115, 58, + 131,220,175, 17,195,105, 26,204,115,105,223,163, 90,194,141, 19,118, + 67,158,167,163,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,169,220,193, + 16,189,101, 17,193,103, 19,194,105, 89,211,149,103,201,152, 22,124, + 71,136,156,146,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255, 4,115, 58,169,220,193, 13,179, 94, + 14,182, 96, 14,182, 96, 13,180, 95, 71,196,132,112,202,156, 29,130, + 77,103,140,121,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255, 4,115, 58,169,220,193, 12,170, 88, 18,174, 94, + 21,175, 96, 22,173, 97, 19,170, 93, 58,182,119,117,199,157, 40,137, + 87, 78,131,103,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255, 4,115, 58,169,220,193, 46,173,107, 43,173,106, 39,171,104, + 34,169,100, 28,165, 95, 65,178,120,120,198,159, 41,136, 88,103,140, + 121,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4, + 115, 58,169,220,193, 54,173,112, 50,172,109, 45,170,106, 40,168,102, + 88,188,137,120,197,157, 31,128, 78,131,154,142,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,169, + 220,193, 62,177,118, 58,175,115, 54,174,112,111,197,152,113,191,151, + 24,123, 73,166,176,171,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255, 4,115, 58,169,220,193, 69, + 180,123, 71,180,124,130,204,166,103,182,140, 23,119, 69,193,197,195, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255, 4,115, 58,165,218,191, 87,187,135,144, + 210,176, 91,171,130, 35,119, 76,212,213,212,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 4,115, 58,169,220,193,155,213,183, 76,159,115, 61, + 125, 92,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255, 4,115, 58,164,217,190, 61,147,102, 95,136,115,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 4,115, + 58, 45,136, 89,133,156,144,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255); + +Const + DBS_pause : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,152,112, 80,164,101, + 52,164,101, 52,152,112, 80,255, 0,255,255, 0,255,152,112, 80,164, + 101, 52,164,101, 52,152,112, 80,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,159,104, 62,201,156,118,205,165, + 133,159,104, 62,255, 0,255,255, 0,255,159,104, 62,201,156,118,205, + 165,133,159,104, 62,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,163,101, 53,215,172,136,225,197,173,163,101, + 53,255, 0,255,255, 0,255,163,101, 53,215,172,136,225,197,173,163, + 101, 53,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,164,101, 52,216,169,129,230,204,181,164,101, 52,255, 0, + 255,255, 0,255,164,101, 52,216,169,129,230,204,181,164,101, 52,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 164,101, 52,215,167,127,230,204,181,164,101, 52,255, 0,255,255, 0, + 255,164,101, 52,215,167,127,230,204,181,164,101, 52,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,164,101, 52, + 215,169,129,230,205,182,164,101, 52,255, 0,255,255, 0,255,164,101, + 52,215,169,129,230,205,182,164,101, 52,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,164,101, 52,216,171,132, + 230,206,183,164,101, 52,255, 0,255,255, 0,255,164,101, 52,216,171, + 132,230,206,183,164,101, 52,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,164,101, 52,217,174,137,230,206,183, + 164,101, 52,255, 0,255,255, 0,255,164,101, 52,217,174,137,230,206, + 183,164,101, 52,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,164,101, 52,217,176,141,230,206,183,164,101, 52, + 255, 0,255,255, 0,255,164,101, 52,217,176,141,230,206,183,164,101, + 52,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,164,101, 52,217,178,143,230,206,183,164,101, 52,255, 0,255, + 255, 0,255,164,101, 52,217,178,143,230,206,183,164,101, 52,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,164, + 101, 52,218,179,145,230,206,183,164,101, 52,255, 0,255,255, 0,255, + 164,101, 52,218,179,145,230,206,183,164,101, 52,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,164,101, 52,218, + 181,147,230,207,185,164,101, 52,255, 0,255,255, 0,255,164,101, 52, + 218,181,147,230,207,185,164,101, 52,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,164,101, 52,219,182,148,231, + 209,187,164,101, 52,255, 0,255,255, 0,255,164,101, 52,219,182,148, + 231,209,187,164,101, 52,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,164,101, 52,221,188,157,231,209,188,164, + 101, 52,255, 0,255,255, 0,255,164,101, 52,221,188,157,231,209,188, + 164,101, 52,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,162,102, 55,220,191,164,223,198,175,162,102, 55,255, + 0,255,255, 0,255,162,102, 55,220,191,164,223,198,175,162,102, 55, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,153,110, 76,171,113, 67,172,114, 68,153,110, 76,255, 0,255,255, + 0,255,153,110, 76,171,113, 67,172,114, 68,153,110, 76,255, 0,255, + 255, 0,255,255, 0,255); + +Const + DBS_stop : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255, 87, 72,197, 76, 51,146, 76, 51,146, 76, 51,146, 76, 51, + 146, 76, 51,146, 76, 51,146, 76, 51,146, 76, 51,146, 76, 51,146, 76, + 51,146, 76, 51,146,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 87, 72,197,135,150,246,124,141,247,114,132,248,104,124,248, 94,115, + 250, 83,106,250, 74, 99,250, 66, 92,251, 58, 85,252, 51, 79,252, 76, + 51,146,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 87, 72,197, + 146,158,245,135,150,246,124,141,247,114,133,248,104,124,249, 94,115, + 249, 84,107,250, 75, 99,251, 66, 92,251, 57, 85,252, 76, 51,146,255, + 0,255,255, 0,255,255, 0,255,255, 0,255, 87, 72,197,155,167,245, + 146,159,245,135,150,247,124,141,247,114,132,248,103,124,248, 94,115, + 249, 84,107,250, 74, 99,251, 65, 92,251, 76, 51,146,255, 0,255,255, + 0,255,255, 0,255,255, 0,255, 87, 72,197,166,175,244,156,167,245, + 145,159,245,135,150,246,125,141,247,113,132,247,104,124,248, 93,115, + 249, 84,106,250, 74, 99,251, 76, 51,146,255, 0,255,255, 0,255,255, + 0,255,255, 0,255, 87, 72,197,174,183,243,165,175,245,156,167,245, + 145,159,245,135,150,247,124,141,247,114,132,248,104,123,249, 93,115, + 249, 83,107,250, 76, 51,146,255, 0,255,255, 0,255,255, 0,255,255, + 0,255, 87, 72,197,183,190,243,175,183,244,166,176,244,155,168,245, + 146,159,246,135,150,246,124,141,247,114,132,248,103,123,248, 93,115, + 249, 76, 51,146,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 87, + 72,197,191,197,242,183,190,243,175,183,244,165,175,244,156,167,245, + 146,159,246,135,149,246,125,141,247,114,132,248,104,124,248, 76, 51, + 146,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 87, 72,197,199, + 202,241,191,197,243,183,190,243,174,183,244,166,175,244,155,167,245, + 146,159,246,135,150,246,124,141,247,114,132,247, 76, 51,146,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255, 87, 72,197,204,208,241,198, + 203,241,191,197,242,183,191,243,175,183,244,166,175,245,155,168,245, + 145,159,246,135,150,246,125,141,247, 76, 51,146,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255, 87, 72,197,209,212,241,204,208,242,198, + 203,242,191,197,242,183,190,243,174,184,243,165,175,244,155,168,244, + 145,159,245,135,149,246, 76, 51,146,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 87, 72,197, 87, 72,197, 87, 72,197, 87, 72,197, 87, + 72,197, 87, 72,197, 87, 72,197, 87, 72,197, 87, 72,197, 87, 72,197, + 87, 72,197, 87, 72,197,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255); diff --git a/examples/apps/debugserver/images/clean.bmp b/examples/apps/debugserver/images/clean.bmp Binary files differnew file mode 100644 index 00000000..74575793 --- /dev/null +++ b/examples/apps/debugserver/images/clean.bmp diff --git a/examples/apps/debugserver/images/pause.bmp b/examples/apps/debugserver/images/pause.bmp Binary files differnew file mode 100644 index 00000000..677d37b2 --- /dev/null +++ b/examples/apps/debugserver/images/pause.bmp diff --git a/examples/apps/debugserver/images/run.bmp b/examples/apps/debugserver/images/run.bmp Binary files differnew file mode 100644 index 00000000..9cccfaa0 --- /dev/null +++ b/examples/apps/debugserver/images/run.bmp diff --git a/examples/apps/debugserver/images/state_error.bmp b/examples/apps/debugserver/images/state_error.bmp Binary files differnew file mode 100644 index 00000000..d99e6440 --- /dev/null +++ b/examples/apps/debugserver/images/state_error.bmp diff --git a/examples/apps/debugserver/images/state_info.bmp b/examples/apps/debugserver/images/state_info.bmp Binary files differnew file mode 100644 index 00000000..d92895ae --- /dev/null +++ b/examples/apps/debugserver/images/state_info.bmp diff --git a/examples/apps/debugserver/images/state_lightbulb.bmp b/examples/apps/debugserver/images/state_lightbulb.bmp Binary files differnew file mode 100644 index 00000000..f9937c70 --- /dev/null +++ b/examples/apps/debugserver/images/state_lightbulb.bmp diff --git a/examples/apps/debugserver/images/state_lightbulb_off.bmp b/examples/apps/debugserver/images/state_lightbulb_off.bmp Binary files differnew file mode 100644 index 00000000..1bdcdb45 --- /dev/null +++ b/examples/apps/debugserver/images/state_lightbulb_off.bmp diff --git a/examples/apps/debugserver/images/state_warning.bmp b/examples/apps/debugserver/images/state_warning.bmp Binary files differnew file mode 100644 index 00000000..e1a75926 --- /dev/null +++ b/examples/apps/debugserver/images/state_warning.bmp diff --git a/examples/apps/debugserver/images/status.bmp b/examples/apps/debugserver/images/status.bmp Binary files differnew file mode 100644 index 00000000..4bdd4ad7 --- /dev/null +++ b/examples/apps/debugserver/images/status.bmp diff --git a/examples/apps/debugserver/images/stop.bmp b/examples/apps/debugserver/images/stop.bmp Binary files differnew file mode 100644 index 00000000..f27fc185 --- /dev/null +++ b/examples/apps/debugserver/images/stop.bmp diff --git a/examples/apps/debugserver/state_images.inc b/examples/apps/debugserver/state_images.inc new file mode 100644 index 00000000..1c6aa2e3 --- /dev/null +++ b/examples/apps/debugserver/state_images.inc @@ -0,0 +1,260 @@ + +Const + DBS_state_info : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,241, 12,227,203, 41, + 155,161, 70, 81,144, 76, 62,142, 75, 62,154, 69, 82,197, 39,156,238, + 11,227,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,224, 28,189,163, 77, 72,178,128, 87,213,183, + 147,219,195,166,218,195,166,210,180,144,171,122, 82,146, 71, 72,216, + 26,189,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 226, 32,189,163, 81, 60,203,167,125,216,187,159,195,156,119,182,138, + 98,180,134, 96,190,150,114,209,179,151,197,163,119,137, 76, 62,217, + 26,189,255, 0,255,255, 0,255,255, 0,255,244, 15,228,180, 94, 74, + 207,170,129,218,188,162,190,145,102,186,140, 98,183,137, 95,179,132, + 94,177,131, 93,176,131, 92,205,170,141,198,165,121,149, 72, 73,239, + 11,228,255, 0,255,255, 0,255,220, 59,155,191,145, 94,224,194,168, + 197,150,108,194,145,105,225,203,184,254,253,252,255,255,254,234,220, + 208,180,133, 94,179,133, 94,212,181,153,174,123, 86,200, 40,155,255, + 0,255,255, 0,255,197,108, 82,219,188,156,213,173,137,199,152,108, + 195,149,105,193,147,103,237,223,211,250,247,244,187,139, 99,185,138, + 99,184,138, 98,197,157,120,210,184,147,160, 70, 82,255, 0,255,255, + 0,255,193,122, 60,227,199,175,208,162,118,197,153,107,196,151,106, + 196,150,105,238,224,212,251,247,244,191,144,102,190,143,101,190,143, + 100,190,146,105,223,198,170,150, 77, 59,255, 0,255,255, 0,255,199, + 128, 66,228,201,176,208,163,122,204,157,113,199,154,108,197,152,107, + 255,255,255,255,255,254,195,150,105,193,148,104,194,148,104,195,152, + 109,223,197,171,153, 80, 59,255, 0,255,255, 0,255,210,122, 92,224, + 188,159,219,179,147,207,160,117,205,158,114,203,156,113,221,191,163, + 221,191,162,197,153,107,197,153,107,196,152,107,209,171,133,216,186, + 151,172, 74, 82,255, 0,255,255, 0,255,231, 72,164,205,156,104,231, + 203,180,212,165,122,208,160,119,207,158,116,251,248,245,251,248,245, + 203,158,113,203,157,113,205,161,119,223,192,165,185,138, 91,210, 45, + 155,255, 0,255,255, 0,255,249, 20,231,211,128, 90,217,178,140,230, + 202,179,214,169,125,209,165,121,226,196,168,225,195,168,208,162,118, + 209,164,119,221,189,162,208,172,133,180, 92, 74,244, 13,228,255, 0, + 255,255, 0,255,255, 0,255,241, 49,197,209,135, 79,217,178,140,230, + 205,184,224,186,157,215,171,133,214,169,130,217,179,145,225,194,171, + 212,174,134,180,102, 62,230, 36,189,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,242, 49,198,214,131, 91,208,160,106,224, + 191,160,227,197,174,227,197,174,223,188,159,200,151, 98,195,113, 73, + 233, 41,189,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,250, 21,231,234, 74,168,216,125,101,207, + 133, 78,205,132, 74,209,119, 91,228, 68,161,247, 19,228,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255); + +Const + DBS_state_lightbulb : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,212, 61, + 230, 79, 77, 92, 69, 69, 70, 64, 65, 66, 70, 68, 80,201, 65,223,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,131, 85,149,188,188, + 187,235,234,234,205,204,204,163,161,159, 90, 65,109,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,121,105,140,166,165,162,168,162, + 162,157,153,152,148,143,139, 82, 69, 96,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,219, 49,236,102,126,151,122,149,163, 58,138,152, 53,127, + 140, 96,110,118, 46, 67, 88,223, 41,239,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,227, 38,251, + 112,151,225, 70,157,230, 75,190,247, 71,230,253, 65,229,253, 81,195, + 251, 22,124,222, 61,123,211,213, 47,247,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,230, 35,251,105,159,233,166,211,243, + 101,174,240,116,225,246,115,225,246,114,224,246,113,224,246, 76,163, + 236,156,195,239, 44,125,215,201, 59,245,255, 0,255,255, 0,255,255, + 0,255,253, 3,255,127,153,236,165,212,243,220,250,254, 56,161,235, + 116,225,246,106,228,246, 93,226,245,114,224,246, 22,145,232,192,245, + 253,172,206,241, 45,124,215,234, 25,251,255, 0,255,255, 0,255,183, + 102,245,139,200,239,236,252,254,119,225,247, 47,153,234,117,225,246, + 116,225,246,104,222,245,115,225,246, 9,134,230, 70,213,243,220,254, + 254,111,170,229,121,115,230,255, 0,255,255, 0,255,127,169,238,201, + 233,249,212,249,253,124,227,247,134,229,248, 96,177,239,104,181,239, + 99,180,239, 76,166,236,130,228,247, 89,220,245,138,235,250,203,226, + 247, 57,135,218,255, 0,255,255, 0,255,126,192,238,223,246,253,200, + 245,252,205,246,252,214,247,253,211,244,252,207,242,252,202,241,251, + 196,240,252,186,242,251,150,234,248,114,229,247,226,244,253, 50,136, + 216,255, 0,255,255, 0,255,149,183,242,210,239,251,219,249,254,223, + 249,253,236,251,254,238,252,254,239,252,254,239,252,254,235,251,254, + 224,249,254,184,241,251,168,241,251,203,229,248, 62,141,221,255, 0, + 255,255, 0,255,200,115,249,180,227,248,229,250,254,219,248,253,228, + 250,254,240,252,254,249,254,255,249,254,255,239,252,254,210,246,253, + 180,241,251,237,253,255,107,179,234,136,121,236,255, 0,255,255, 0, + 255,252, 10,255,181,173,246,195,235,250,226,249,253,224,249,253,213, + 247,253,207,246,253,201,244,252,199,244,252,214,249,253,235,250,254, + 144,202,242, 80,151,230,243, 17,253,255, 0,255,255, 0,255,255, 0, + 255,247, 22,254,196,159,249,183,228,248,199,236,251,215,243,252,225, + 247,253,226,248,254,216,240,252,182,223,248,107,187,237,108,152,235, + 232, 33,252,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,227, 82,251,193,156,248,168,192,246,148,202,241,133, + 197,240,128,182,240,135,157,240,187, 98,246,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255); + +Const + DBS_state_warning : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 123,108,237, 45,167,224, 43,164,223, 41,161,221, 39,158,220, 37,155, + 218, 35,152,217, 32,147,214, 27,140,211, 22,133,207, 17,126,204, 13, + 119,201, 9,113,198, 6,108,195, 3,104,193, 93, 64,214, 72,154,230, + 190,227,245,244,252,254,239,251,254,238,251,254,238,251,254,239,252, + 254,239,252,254,239,251,254,238,251,254,237,251,254,237,251,254,236, + 251,254,242,252,254,171,206,235, 42, 88,202,195, 52,247, 98,191,232, + 244,252,254,181,239,250, 88,218,245, 88,218,245, 87,216,243, 88,215, + 242, 88,214,242, 87,217,244, 81,216,245, 78,215,244, 98,218,246,234, + 251,254, 68,147,210,182, 32,237,255, 0,255, 94,139,234,157,215,241, + 231,249,253,139,229,248, 90,219,246, 91,218,244, 61,161,213, 61,161, + 213, 84,214,242, 82,216,245, 80,214,244,216,246,252,136,191,229, 85, + 85,217,255, 0,255,255, 0,255,227, 25,251, 55,174,229,243,251,254, + 195,242,251, 92,220,246, 92,218,244,100,223,246, 87,203,235, 85,214, + 242, 84,217,245,148,231,248,227,244,251, 28,132,209,222, 18,248,255, + 0,255,255, 0,255,255, 0,255,121,119,238,140,210,240,234,251,254, + 148,230,248, 92,218,244, 71,177,221, 61,161,213, 86,215,242, 92,219, + 245,222,248,253,125,192,231,135, 75,232,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,246, 9,254, 69,167,232,200,234,247,230,250,253, + 93,218,244, 61,161,213, 61,161,213, 87,215,242,199,243,252,192,227, + 244, 59,137,221,245, 7,253,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,185, 64,247,113,200,237,249,254,255, 94,220,244, + 62,162,213, 62,162,213, 92,217,244,237,251,254,104,187,229,178, 55, + 242,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255, 90,152,236,169,223,244,237,249,253, 62,163,214, + 62,163,214,212,245,252,162,215,241, 93,125,230,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,218, 35,251, 58,182,232,249,253,255,148,233,249,158,235,250, + 236,250,254, 49,167,225,215, 31,249,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,116,131,239,148,216,242,243,252,254,231,250,254,143,211,240, + 134,101,239,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,241, + 13,254, 68,177,234,241,250,253,213,239,250, 67,165,232,241, 12,253, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,141, + 110,243,133,212,241,130,209,240,173, 75,245,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,253, 2,255, 93, + 156,238,104,142,239,253, 2,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255); + +Const + DBS_state_error : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,227, 11,247,154, 37, + 227, 76, 62,204, 54, 67,197, 52, 65,195, 70, 57,199,149, 31,222,225, + 9,246,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,191, 27,239, 76, 74,209, 82,100,212,132,144, + 231,149,160,238,149,159,237,131,142,229, 76, 93,206, 61, 59,195,184, + 21,233,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 193, 30,241, 71, 85,213,117,132,227,161,172,244,127,139,236, 92,103, + 228, 91,102,227,125,135,234,159,168,241,111,124,221, 50, 64,194,185, + 21,234,255, 0,255,255, 0,255,255, 0,255,231, 13,250, 89, 86,222, + 120,136,230,163,176,245, 87,103,231, 86,101,230,137,146,237,136,146, + 236, 83, 95,226, 82, 93,225,159,169,242,111,125,221, 65, 61,198,226, + 9,246,255, 0,255,255, 0,255,168, 51,240, 96,115,224,164,179,247, + 90,110,235, 89,108,234, 88,105,232,255,255,255,255,255,255, 85, 98, + 229, 84, 97,227, 83, 95,226,159,169,242, 80, 97,209,151, 35,225,255, + 0,255,255, 0,255,106, 94,233,142,159,240,132,153,244, 92,115,238, + 91,112,236, 90,110,235,144,157,241,166,175,243, 87,103,231, 86,101, + 230, 85, 98,229,125,137,235,133,145,231, 78, 64,206,255, 0,255,255, + 0,255, 93,109,234,160,179,247,101,128,242, 95,120,240, 93,118,239, + 92,115,238,211,217,250,255,255,255, 89,108,234, 88,105,232, 87,103, + 231, 93,108,231,153,165,241, 60, 76,204,255, 0,255,255, 0,255, 97, + 114,238,161,182,248,103,132,244, 96,124,243, 95,122,241, 95,120,240, + 255,255,255,255,255,255, 91,112,236, 90,110,235, 89,108,234, 95,111, + 233,155,168,241, 65, 80,208,255, 0,255,255, 0,255,118,105,243,145, + 166,243,136,161,248, 98,128,244, 97,126,243, 96,124,243,255,255,255, + 255,255,255, 93,118,239, 92,115,238, 91,112,236,130,147,241,137,152, + 236, 89, 76,216,255, 0,255,255, 0,255,178, 62,250,108,129,236,169, + 189,251, 99,130,245, 98,129,245, 98,128,244,255,255,255,255,255,255, + 95,122,241, 95,120,240, 93,118,239,165,181,248, 93,112,221,162, 46, + 235,255, 0,255,255, 0,255,235, 17,254,117,114,247,131,151,240,169, + 189,251, 99,130,245, 99,130,245,255,255,255,255,255,255, 97,126,243, + 96,124,243,166,185,249,123,141,234, 92, 90,225,231, 13,250,255, 0, + 255,255, 0,255,255, 0,255,206, 43,253,109,123,248,132,151,241,169, + 189,251,138,163,248,107,137,246,107,137,246,137,162,248,168,188,250, + 127,146,236, 89,103,229,198, 34,246,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,206, 43,253,119,117,250,110,131,238,146, + 166,244,160,180,248,160,180,248,145,166,243,104,125,233,105,104,237, + 200, 37,248,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,235, 18,255,181, 65,253,124,112,250,108, + 122,247,106,120,245,119,106,245,177, 60,248,233, 16,253,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255); + +Const + DBS_state_lightbulb_off : Array[0..821] of byte = ( + 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,212, 61, + 230, 79, 77, 92, 69, 69, 70, 64, 65, 66, 70, 68, 80,201, 65,223,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,131, 85,149,188,188, + 187,235,234,234,205,204,204,163,161,159, 90, 65,109,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,121,105,140,166,165,162,168,162, + 162,157,153,152,148,143,139, 82, 69, 96,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,243, 57,227,102,126,151,152,161,154,105,145,134,100,136, + 123,129,127,113, 46, 67, 88,244, 48,230,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,248, 41,238, + 216,175,166,207,186,147,212,193,158,213,194,160,212,193,157,215,197, + 164,195,168,118,201,164,133,244, 54,229,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,249, 38,240,215,178,166,232,222,203, + 217,200,168,221,206,179,221,206,178,221,206,178,221,206,178,210,190, + 154,229,217,196,198,168,125,241, 69,222,255, 0,255,255, 0,255,255, + 0,255,255, 3,254,222,169,180,232,222,203,247,243,237,145,174,179, + 221,206,179,219,203,174,216,199,167,221,206,178,127,161,167,240,234, + 222,233,223,205,198,165,126,249, 29,242,255, 0,255,255, 0,255,236, + 109,213,225,212,187,251,249,246,223,209,182,141,169,176,221,206,179, + 221,206,179,218,202,172,221,206,178,119,153,161,210,190,154,247,243, + 237,217,200,168,219,139,173,255, 0,255,255, 0,255,222,179,180,242, + 236,225,245,240,232,223,209,183,226,213,190,167,189,195,172,192,197, + 169,191,196,156,180,187,224,211,186,215,197,165,228,216,193,242,236, + 225,202,170,134,255, 0,255,255, 0,255,222,201,180,247,243,237,242, + 236,226,243,238,228,245,241,233,244,239,230,243,238,229,242,236,226, + 241,235,224,239,232,218,229,218,197,221,206,178,248,245,239,199,173, + 129,255, 0,255,255, 0,255,227,189,193,243,238,229,246,242,236,247, + 243,237,251,249,246,251,249,246,251,249,246,251,249,246,250,248,244, + 248,245,239,238,231,217,234,225,208,242,236,225,204,172,139,255, 0, + 255,255, 0,255,241,117,224,237,229,214,249,247,242,246,242,236,249, + 247,242,251,250,247,254,254,253,254,254,253,251,249,246,244,239,230, + 237,229,214,251,249,246,217,200,168,224,136,184,255, 0,255,255, 0, + 255,254, 10,253,236,174,212,240,234,222,248,245,239,247,243,237,245, + 241,233,243,238,229,242,236,226,242,236,225,245,241,233,250,248,244, + 227,215,192,209,171,152,252, 18,248,255, 0,255,255, 0,255,255, 0, + 255,253, 22,251,240,161,221,237,229,214,242,236,225,245,241,233,248, + 245,239,248,245,240,245,241,233,237,229,214,217,200,169,218,168,170, + 249, 35,241,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,248, 82,239,239,158,220,234,195,206,228,208,194,224, + 203,185,222,190,182,225,165,186,237,102,215,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255); diff --git a/examples/apps/docedit/docedit.lpi b/examples/apps/docedit/docedit.lpi index 98b5cf0f..640d3114 100644 --- a/examples/apps/docedit/docedit.lpi +++ b/examples/apps/docedit/docedit.lpi @@ -1,15 +1,14 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> @@ -31,7 +30,7 @@ <PackageName Value="fpgui_toolkit"/> </Item1> </RequiredPackages> - <Units Count="8"> + <Units Count="7"> <Unit0> <Filename Value="docedit.lpr"/> <IsPartOfProject Value="True"/> @@ -58,27 +57,19 @@ <UnitName Value="FPDEUtil"/> </Unit4> <Unit5> - <Filename Value="pkeditor.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="PkEditor"/> - </Unit5> - <Unit6> <Filename Value="doceditmsg.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="doceditmsg"/> - </Unit6> - <Unit7> + </Unit5> + <Unit6> <Filename Value="doceditopts.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="doceditopts"/> - </Unit7> + </Unit6> </Units> </ProjectOptions> <CompilerOptions> - <Version Value="5"/> - <CodeGeneration> - <Generate Value="Faster"/> - </CodeGeneration> + <Version Value="8"/> <Other> <CustomOptions Value="-FUunits"/> <CompilerPath Value="$(CompPath)"/> diff --git a/examples/apps/docedit/docedit.lpr b/examples/apps/docedit/docedit.lpr index e9a6a915..07f849e5 100644 --- a/examples/apps/docedit/docedit.lpr +++ b/examples/apps/docedit/docedit.lpr @@ -7,9 +7,8 @@ uses cthreads, {$ENDIF}{$ENDIF} Classes, - fpgfx, - frm_main, frm_options, model, FPDEUtil, PkEditor, doceditmsg, doceditopts, - fpgui_toolkit; + fpg_main, + frm_main, frm_options, model, FPDEUtil, doceditmsg, doceditopts; procedure MainProc; diff --git a/examples/apps/docedit/frm_main.pas b/examples/apps/docedit/frm_main.pas index e2ddca95..f6404b79 100644 --- a/examples/apps/docedit/frm_main.pas +++ b/examples/apps/docedit/frm_main.pas @@ -11,16 +11,16 @@ interface uses Classes, SysUtils, - gfxbase, - fpgfx, - gui_form, - gui_button, - gui_edit, - gui_label, - gui_menu, - gui_memo, - gui_tree, - gui_bevel, + fpg_base, + fpg_main, + fpg_form, + fpg_button, + fpg_edit, + fpg_label, + fpg_menu, + fpg_memo, + fpg_tree, + fpg_panel, dom, XMLWrite, XMLRead, contnrs, model; type @@ -63,7 +63,7 @@ type implementation uses - gui_dialogs, frm_options; + fpg_dialogs, frm_options; const @@ -150,7 +150,7 @@ begin ShowMessage(cAppName + #10 + #10 + 'Written by Graeme Geldenhuys - 2007' - + #10 + 'Using the ' + fpGUIName + ' v' + fpGUIVersion + + #10 + 'Using the ' + fpGUIName + ' v' + fpGUI_Version ,'About'); end; @@ -275,7 +275,6 @@ begin Text := 'Quit'; FontDesc := '#Label1'; ImageName := 'stdimg.Quit'; - ModalResult := 0; ShowImage := True; OnClick := @btnQuitClicked; end; diff --git a/examples/apps/docedit/frm_options.pas b/examples/apps/docedit/frm_options.pas index 0b552317..d34ef758 100644 --- a/examples/apps/docedit/frm_options.pas +++ b/examples/apps/docedit/frm_options.pas @@ -5,12 +5,12 @@ unit frm_options; interface uses - SysUtils, Classes, gfxbase, fpgfx, gui_edit, - gfx_widget, gui_form, gui_label, gui_button, - gui_listbox, gui_memo, gui_combobox, gui_grid, - gui_dialogs, gui_checkbox, gui_tree, gui_trackbar, - gui_progressbar, gui_radiobutton, gui_tab, gui_menu, - gui_bevel; + SysUtils, Classes, fpg_base, fpg_main, fpg_edit, + fpg_widget, fpg_form, fpg_label, fpg_button, + fpg_listbox, fpg_memo, fpg_combobox, fpg_grid, + fpg_dialogs, fpg_checkbox, fpg_tree, fpg_trackbar, + fpg_progressbar, fpg_radiobutton, fpg_tab, fpg_menu, + fpg_panel; type @@ -155,7 +155,6 @@ begin Text := '...'; FontDesc := '#Label1'; ImageName := ''; - ModalResult := 0; end; edtFPDoc := TfpgEdit.Create(self); @@ -175,7 +174,6 @@ begin Text := '...'; FontDesc := '#Label1'; ImageName := ''; - ModalResult := 0; end; cbShowHints := TfpgCheckBox.Create(self); @@ -204,7 +202,7 @@ begin Text := 'OK'; FontDesc := '#Label1'; ImageName := 'stdimg.ok'; - ModalResult := 1; + ModalResult := mrOK; end; btnCancel := TfpgButton.Create(self); @@ -215,7 +213,7 @@ begin Text := 'Cancel'; FontDesc := '#Label1'; ImageName := 'stdimg.cancel'; - ModalResult := 2; + ModalResult := mrCancel; end; lblName5 := TfpgLabel.Create(self); diff --git a/examples/apps/docedit/pkeditor.pas b/examples/apps/docedit/pkeditor.pas index 0dcde7f1..57caf197 100644 --- a/examples/apps/docedit/pkeditor.pas +++ b/examples/apps/docedit/pkeditor.pas @@ -27,8 +27,8 @@ unit PkEditor; interface uses - SysUtils, Classes, DOM, gui_bevel, gui_label, gui_tree, gui_menu, - gfx_imagelist, FPDEUtil, doceditmsg, doceditopts; + SysUtils, Classes, DOM, fpg_panel, fpg_label, fpg_tree, fpg_menu, + fpg_imagelist, FPDEUtil, doceditmsg, doceditopts; Type { TPackageEditor } diff --git a/examples/corelib/canvastest/fpgcanvas.lpi b/examples/corelib/canvastest/fpgcanvas.lpi index 66833b5b..5516e884 100644 --- a/examples/corelib/canvastest/fpgcanvas.lpi +++ b/examples/corelib/canvastest/fpgcanvas.lpi @@ -5,15 +5,16 @@ <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <MainUnitHasCreateFormStatements Value="False"/> + <MainUnitHasTitleStatement Value="False"/> <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> <TargetFileExt Value=""/> - <Title Value="fpcanvas"/> </General> <VersionInfo> - <ProjectVersion Value=""/> + <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> </VersionInfo> <PublishOptions> <Version Value="2"/> @@ -45,6 +46,9 @@ <SmartLinkUnit Value="True"/> </CodeGeneration> <Linking> + <Debugging> + <UseLineInfoUnit Value="False"/> + </Debugging> <LinkSmart Value="True"/> </Linking> <Other> diff --git a/examples/corelib/canvastest/fpgcanvas.lpr b/examples/corelib/canvastest/fpgcanvas.lpr index c5473ba9..9d0656e4 100644 --- a/examples/corelib/canvastest/fpgcanvas.lpr +++ b/examples/corelib/canvastest/fpgcanvas.lpr @@ -15,20 +15,18 @@ uses type - { TMainForm } - TMainForm = class(TfpgForm) private + {@VFD_HEAD_BEGIN: MainForm} + {@VFD_HEAD_END: MainForm} bmp: TfpgImage; dst: TfpgImage; - procedure FormPaint(Sender: TObject); - procedure CustomPaintJob; - protected - procedure HandlePaint; override; + procedure FormPaint(Sender: TObject); + procedure CustomPaintJob; public - procedure AfterCreate; override; - procedure AfterConstruction; override; - procedure BeforeDestruction; override; + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure AfterCreate; override; end; { TMainForm } @@ -46,10 +44,17 @@ var fnt: TfpgFont; y: integer; c: TfpgColor; + lImage: TfpgImage; begin // Testing Rectangles Canvas.SetColor(clBlack); - r.SetRect(0, 0, 1, 1); + r.SetRect(0, 0, 1, 1); // 1x1 (this is really a dot) + Canvas.DrawRectangle(r); + Canvas.SetColor(clRed); + r.SetRect(0, 1, 1, 5); // 1x5 (this is really a vertical line) + Canvas.DrawRectangle(r); + Canvas.SetColor(clMagenta); + r.SetRect(1, 0, 5, 1); // 5x1 (this is really a horizontal line) Canvas.DrawRectangle(r); Canvas.SetColor(clBlack); @@ -138,15 +143,26 @@ begin // Testing Bitmap painting Canvas.DrawString(5, 180, 'Single BMP file:'); - Canvas.DrawString(300, 210, '(mask enabled for all images)'); + Canvas.DrawString(310, 210, '(mask enabled for all images)'); Canvas.DrawImage(150, 180, bmp); Canvas.DrawString(5, 210, 'Parts of BMP file:'); Canvas.DrawImagePart(150, 210, bmp, 0, 0, 32, 21); Canvas.DrawImagePart(190, 210, bmp, 32, 0, 32, 21); Canvas.DrawImagePart(230, 210, bmp, 64, 0, 32, 21); + // create image from an image + r.SetRect(32, 0, 32, 21); // second button in image + lImage := bmp.ImageFromRect(r); + try + lImage.CreateMaskFromSample(0, 0); + lImage.UpdateImage; + Canvas.DrawImage(270, 215, lImage); + finally + lImage.Free; + end; - Canvas.StretchDraw(150, 240, 300, 50, bmp); + // Testing Bitmap strechdraw + Canvas.StretchDraw(150, 240, 300, 50, bmp); Canvas.DrawImage(150, 300, dst); Canvas.StretchDraw(180, 300, 70, 70, dst); Canvas.StretchDraw(265, 300, 230, 25, bmp); @@ -186,47 +202,46 @@ begin // Gradient testing r.SetRect(265, 340, 185, 35); Canvas.GradientFill(r, clBlue, clMagenta, gdHorizontal); - -end; - -procedure TMainForm.HandlePaint; -begin - inherited HandlePaint; -// CustomPaintJob; end; -procedure TMainForm.AfterCreate; +constructor TMainForm.Create(AOwner: TComponent); begin - inherited AfterCreate; - SetPosition(100, 100, 500, 400); - WindowTitle := 'fpGFX Canvas Test'; + inherited Create(AOwner); bmp := LoadImage_BMP('button.bmp'); if not Assigned(bmp) then raise Exception.Create('Failed to load button.bmp'); bmp.CreateMaskFromSample(0,0); bmp.UpdateImage; - -// dst := TfpgImage.Create; -// dst.AllocateImage(bmp.ColorDepth, 200, 50); + dst := LoadImage_BMP('gears2.bmp'); dst.CreateMaskFromSample(0,0); dst.UpdateImage; end; -procedure TMainForm.AfterConstruction; +destructor TMainForm.Destroy; begin - inherited AfterConstruction; - OnPaint := @FormPaint; + dst.Free; + bmp.Free; + inherited Destroy; end; -procedure TMainForm.BeforeDestruction; +procedure TMainForm.AfterCreate; begin - dst.Free; - bmp.Free; - inherited BeforeDestruction; + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: MainForm} + Name := 'MainForm'; + SetPosition(357, 214, 500, 400); + WindowTitle := 'fpGUI Canvas Test'; + Hint := ''; + WindowPosition := wpOneThirdDown; + OnPaint := @FormPaint; + + {@VFD_BODY_END: MainForm} + {%endregion} end; + procedure MainProc; var frm: TMainForm; diff --git a/examples/corelib/canvastest/linux_screenshot.png b/examples/corelib/canvastest/linux_screenshot.png Binary files differindex e7268d23..bd5c519c 100644 --- a/examples/corelib/canvastest/linux_screenshot.png +++ b/examples/corelib/canvastest/linux_screenshot.png diff --git a/examples/corelib/canvastest/windows_screenshot.png b/examples/corelib/canvastest/windows_screenshot.png Binary files differnew file mode 100644 index 00000000..13305e95 --- /dev/null +++ b/examples/corelib/canvastest/windows_screenshot.png diff --git a/examples/corelib/compileall.sh b/examples/corelib/compileall.sh new file mode 100755 index 00000000..1fed112d --- /dev/null +++ b/examples/corelib/compileall.sh @@ -0,0 +1,16 @@ +#!/bin/sh +FPC=fpc +for f in `find -name '*.lpr'` +do + DIR=`dirname $f` + PROJECT=`basename $f` + LPRNAME=`basename $PROJECT .lpr` + echo Doing $LPRNAME in $DIR + cd $DIR + if [ ! -d units ]; then + echo 'Missing units dir' + mkdir units + fi + $FPC @extrafpc.cfg $PROJECT; + cd .. +done diff --git a/examples/corelib/helloworld/helloworld.pas b/examples/corelib/helloworld/helloworld.pas index be6b99c3..d7178c9d 100644 --- a/examples/corelib/helloworld/helloworld.pas +++ b/examples/corelib/helloworld/helloworld.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -26,6 +26,7 @@ uses const HelloWorldString: String = 'Hello, world!'; + ClickToClose: String = 'click to close'; type @@ -35,6 +36,7 @@ type procedure MsgPaint(var msg: TfpgMessageRec); message FPGM_PAINT; procedure MsgClose(var msg: TfpgMessageRec); message FPGM_CLOSE; procedure MsgResize(var msg: TfpgMessageRec); message FPGM_RESIZE; + procedure MsgMouseUp(var msg: TfpgMessageRec); message FPGM_MOUSEUP; public constructor Create(AOwner: TComponent); override; procedure Show; @@ -55,36 +57,43 @@ begin DoSetWindowVisible(True); // We can't set a title if we don't have a window handle. So we do that here // and not in the constructor. - SetWindowTitle('fpGFX Hello World'); + SetWindowTitle('fpGUI Hello World'); end; procedure TMainWindow.MsgPaint(var msg: TfpgMessageRec); var - Color: TfpgColor; r: TfpgRect; i: Integer; + fnt: TfpgFont; begin Canvas.BeginDraw; // begin double buffering - Color := 0; - r.SetRect(0, 0, Width, 1); - for i := 0 to FHeight-1 do - begin - Color := $ff - (i * $ff) div FHeight; // shades of Blue - Canvas.SetColor(Color); - r.Top := i; - Canvas.DrawRectangle(r); - end; + r.SetRect(0, 0, Width, Height); + Canvas.GradientFill(r, clBlue, clBlack, gdVertical); + + fnt := fpgGetFont('Arial-20'); + try + Canvas.Font := fnt; - Canvas.Font := fpgGetFont('Arial-30'); + Canvas.SetTextColor(clBlack); + Canvas.DrawString((Width - Canvas.Font.TextWidth(HelloWorldString)) div 2 + 1, + (Height - Canvas.Font.Height) div 2 + 1, HelloWorldString); - Canvas.SetTextColor(clBlack); - Canvas.DrawString((Width - Canvas.Font.TextWidth(HelloWorldString)) div 2 + 1, - (Height - Canvas.Font.Height) div 2 + 1, HelloWorldString); + Canvas.SetTextColor(clWhite); + Canvas.DrawString((Width - Canvas.Font.TextWidth(HelloWorldString)) div 2 - 1, + (Height - Canvas.Font.Height) div 2 - 1, HelloWorldString); + finally + fnt.Free; + end; - Canvas.SetTextColor(clWhite); - Canvas.DrawString((Width - Canvas.Font.TextWidth(HelloWorldString)) div 2 - 1, - (Height - Canvas.Font.Height) div 2 - 1, HelloWorldString); + fnt := fpgGetFont('Arial-10'); + try + Canvas.Font := fnt; + Canvas.DrawString((Width - Canvas.Font.TextWidth(ClickToClose)) div 2 - 1, + Height - (Canvas.Font.Height*2), ClickToClose); + finally + fnt.Free; + end; Canvas.EndDraw; end; @@ -92,7 +101,7 @@ end; procedure TMainWindow.MsgClose(var msg: TfpgMessageRec); begin ReleaseWindowHandle; - Halt(0); + fpgApplication.Terminate; end; procedure TMainWindow.MsgResize(var msg: TfpgMessageRec); @@ -101,6 +110,11 @@ begin FHeight := msg.Params.rect.Height; end; +procedure TMainWindow.MsgMouseUp(var msg: TfpgMessageRec); +begin + MsgClose(msg); +end; + var @@ -108,6 +122,7 @@ var begin fpgApplication.Initialize; MainWindow := TMainWindow.Create(nil); + fpgApplication.MainForm := MainWindow; MainWindow.Show; fpgApplication.Run; MainWindow.Free; diff --git a/examples/gui/animation/anim_test.lpi b/examples/gui/animation/anim_test.lpi index b7506331..16a03599 100644 --- a/examples/gui/animation/anim_test.lpi +++ b/examples/gui/animation/anim_test.lpi @@ -1,15 +1,14 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=".elf"/> </General> <VersionInfo> @@ -43,8 +42,7 @@ <CompilerOptions> <Version Value="8"/> <Other> - <CustomOptions Value="-FUunits -"/> + <CustomOptions Value="-FUunits"/> <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> diff --git a/examples/gui/animation/anim_test.lpr b/examples/gui/animation/anim_test.lpr index 79a2bbb8..b7baef3b 100644 --- a/examples/gui/animation/anim_test.lpr +++ b/examples/gui/animation/anim_test.lpr @@ -28,6 +28,8 @@ type lblName1: TfpgLabel; lblName2: TfpgLabel; lblName3: TfpgLabel; + loadinglogo: TfpgImgAnim; + Label1: TfpgLabel; {@VFD_HEAD_END: MainForm} procedure AfterCreate; override; end; @@ -86,7 +88,9 @@ begin SetPosition(212, 216, 80, 24); Text := 'Quit'; FontDesc := '#Label1'; + Hint := ''; ImageName := ''; + TabOrder := 0; OnClick := @btnQuitClicked; end; @@ -97,6 +101,7 @@ begin SetPosition(140, 12, 80, 24); Text := 'Start'; FontDesc := '#Label1'; + Hint := ''; ImageName := ''; TabOrder := 1; OnClick := @btnStartClicked; @@ -139,6 +144,7 @@ begin Name := 'lblName1'; SetPosition(140, 52, 152, 16); FontDesc := '#Label2'; + Hint := ''; Text := 'Step through frames'; end; @@ -146,8 +152,9 @@ begin with lblName2 do begin Name := 'lblName2'; - SetPosition(56, 136, 192, 16); + SetPosition(56, 136, 108, 16); FontDesc := '#Label2'; + Hint := ''; Text := 'Wanda the fish'; end; @@ -157,9 +164,32 @@ begin Name := 'lblName3'; SetPosition(140, 68, 152, 16); FontDesc := '#Label1'; + Hint := ''; Text := '(stop the animation first)'; end; + loadinglogo := TfpgImgAnim.Create(self); + with loadinglogo do + begin + Name := 'loadinglogo'; + SetPosition(236, 156, 16, 16); + IsTransparent := True; + ImageFileName := 'loading.bmp'; + FrameCount := 8; + Interval := 200; + Enabled := True; + end; + + Label1 := TfpgLabel.Create(self); + with Label1 do + begin + Name := 'Label1'; + SetPosition(204, 136, 112, 16); + FontDesc := '#Label2'; + Hint := ''; + Text := 'Loading...'; + end; + {@VFD_BODY_END: MainForm} end; diff --git a/examples/gui/animation/loading.bmp b/examples/gui/animation/loading.bmp Binary files differnew file mode 100644 index 00000000..cf976c53 --- /dev/null +++ b/examples/gui/animation/loading.bmp diff --git a/examples/gui/animation/loading.xcf b/examples/gui/animation/loading.xcf Binary files differnew file mode 100644 index 00000000..77491058 --- /dev/null +++ b/examples/gui/animation/loading.xcf diff --git a/examples/gui/bevel/beveltest.lpi b/examples/gui/bevel/beveltest.lpi index c29961c6..2486d074 100644 --- a/examples/gui/bevel/beveltest.lpi +++ b/examples/gui/bevel/beveltest.lpi @@ -1,19 +1,18 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> - <ProjectVersion Value=""/> + <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> </VersionInfo> <PublishOptions> <Version Value="2"/> diff --git a/examples/gui/bevel/beveltest.lpr b/examples/gui/bevel/beveltest.lpr index f3e1a23c..4fae96c2 100644 --- a/examples/gui/bevel/beveltest.lpr +++ b/examples/gui/bevel/beveltest.lpr @@ -12,7 +12,8 @@ uses fpg_form, fpg_button, fpg_panel, - fpg_label; + fpg_label, + fpg_checkbox; type TMainForm = class(TfpgForm) @@ -25,6 +26,8 @@ type lblStyle: TfpgLabel; lblShape: TfpgLabel; lblNext: TfpgLabel; + chkDouble: TfpgCheckBox; + procedure chkDoubleChanged(Sender: TObject); procedure btnQuitClick(Sender: TObject); procedure btnStylesClick(Sender: TObject); procedure btnShapesClick(Sender: TObject); @@ -34,6 +37,14 @@ type { TMainForm } +procedure TMainForm.chkDoubleChanged(Sender: TObject); +begin + if chkDouble.Checked then + Bevel.BorderStyle := bsDouble + else + Bevel.BorderStyle := bsSingle; +end; + procedure TMainForm.btnQuitClick(Sender: TObject); begin Close; @@ -88,6 +99,8 @@ begin lblNext := CreateLabel(self, 200, 80, 'Next value is...'); btnShapes := CreateButton(self, 200, 100, 90, 'bsFrame', @btnShapesClick); btnStyles := CreateButton(self, 200, 130, 90, 'bsLowered', @btnStylesClick); + chkDouble := CreateCheckBox(self, 200, 160, 'Double Line'); + chkDouble.OnChange := @chkDoubleChanged; lblShape := CreateLabel(self, 6, 190, 'Shape is bsBox'); lblStyle := CreateLabel(self, 6, 210, 'Style is bsRaised'); diff --git a/examples/gui/calendar/calendartest.lpi b/examples/gui/calendar/calendartest.lpi index f4094a2a..20afc9c1 100644 --- a/examples/gui/calendar/calendartest.lpi +++ b/examples/gui/calendar/calendartest.lpi @@ -12,7 +12,7 @@ <TargetFileExt Value=""/> </General> <VersionInfo> - <ProjectVersion Value=""/> + <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> </VersionInfo> <PublishOptions> <Version Value="2"/> @@ -46,6 +46,7 @@ </SyntaxOptions> </Parsing> <Other> + <CustomOptions Value="-FUunits"/> <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> diff --git a/examples/gui/calendar/calendartest.lpr b/examples/gui/calendar/calendartest.lpr index 67e94651..5de312f2 100644 --- a/examples/gui/calendar/calendartest.lpr +++ b/examples/gui/calendar/calendartest.lpr @@ -1,7 +1,3 @@ -{ - This is still under development!!!!!!!!!!!!!!!!! -} - program calendartest; {$mode objfpc}{$H+} @@ -36,6 +32,9 @@ type cbCloseOnSelect: TfpgCheckBox; lblName1: TfpgLabel; bvlName1: TfpgBevel; + CalendarCombo1: TfpgCalendarCheckCombo; + Label1: TfpgLabel; + cbSingleClickClose: TfpgCheckBox; {@VFD_HEAD_END: MainForm} procedure btnDateFormatClicked(Sender: TObject); procedure btnTodayClicked(Sender: TObject); @@ -44,6 +43,7 @@ type procedure cbWHolidayChange(Sender: TObject); procedure cbName1Change(Sender: TObject); procedure cbCloseOnSelectChanged(Sender: TObject); + procedure cbSingleClickCloseChanged(Sender: TObject); procedure btnClearClicked(Sender: TObject); procedure DrawCalendar(month, year: integer); public @@ -60,6 +60,11 @@ begin cal.CloseOnSelect := TfpgCheckBox(Sender).Checked; end; +procedure TMainForm.cbSingleClickCloseChanged(Sender: TObject); +begin + cal.SingleClickSelect := TfpgCheckBox(Sender).Checked; +end; + procedure TMainForm.btnClearClicked(Sender: TObject); begin cbWHoliday.FocusItem := -1; @@ -181,8 +186,9 @@ begin inherited AfterCreate; {@VFD_BODY_BEGIN: MainForm} Name := 'MainForm'; - SetPosition(286, 234, 372, 275); + SetPosition(362, 186, 372, 340); WindowTitle := 'fpGUI Calendar Test'; + Hint := ''; WindowPosition := wpUser; btnClear := TfpgButton.Create(self); @@ -215,6 +221,7 @@ begin Name := 'cbWHoliday'; SetPosition(132, 32, 120, 23); FontDesc := '#List'; + Hint := ''; Items.Add('Sun'); Items.Add('Mon'); Items.Add('Tue'); @@ -232,6 +239,7 @@ begin Name := 'cbName1'; SetPosition(132, 64, 120, 23); FontDesc := '#List'; + Hint := ''; Items.Add('Sun'); Items.Add('Mon'); Items.Add('Tue'); @@ -248,10 +256,11 @@ begin with cal do begin Name := 'cal'; - SetPosition(132, 224, 120, 23); + SetPosition(132, 268, 120, 23); + DateFormat := 'dd mmm yyyy'; FontDesc := '#List'; + Hint := ''; TabOrder := 5; - DateFormat := 'dd mmm yyyy'; DayColor := clBlue; HolidayColor := clRed; SelectedColor:= clYellow; @@ -261,7 +270,7 @@ begin with btnDateFormat do begin Name := 'btnDateFormat'; - SetPosition(232, 116, 75, 23); + SetPosition(232, 160, 75, 23); Text := 'Set Format'; FontDesc := '#Label1'; Hint := ''; @@ -274,7 +283,9 @@ begin with edtDateFormat do begin Name := 'edtDateFormat'; - SetPosition(132, 116, 92, 22); + SetPosition(132, 160, 92, 24); + ExtraHint := ''; + Hint := ''; TabOrder := 7; Text := 'yy-mm-d'; FontDesc := '#Edit1'; @@ -294,7 +305,7 @@ begin with lblName5 do begin Name := 'lblName5'; - SetPosition(8, 228, 104, 15); + SetPosition(8, 272, 104, 15); FontDesc := '#Label1'; Hint := ''; Text := 'Calendar Combo:'; @@ -304,7 +315,7 @@ begin with btnToday do begin Name := 'btnToday'; - SetPosition(256, 224, 59, 23); + SetPosition(256, 268, 59, 23); Text := 'Today'; FontDesc := '#Label1'; Hint := ''; @@ -317,7 +328,9 @@ begin with edtMinDate do begin Name := 'edtMinDate'; - SetPosition(132, 144, 92, 22); + SetPosition(132, 188, 92, 24); + ExtraHint := ''; + Hint := ''; TabOrder := 13; Text := '2005-01-01'; FontDesc := '#Edit1'; @@ -327,7 +340,9 @@ begin with edtMaxDate do begin Name := 'edtMaxDate'; - SetPosition(132, 172, 92, 22); + SetPosition(132, 216, 92, 24); + ExtraHint := ''; + Hint := ''; TabOrder := 14; Text := '2009-01-01'; FontDesc := '#Edit1'; @@ -337,7 +352,7 @@ begin with btnMinDate do begin Name := 'btnMinDate'; - SetPosition(232, 144, 75, 23); + SetPosition(232, 188, 75, 23); Text := 'Min Date'; FontDesc := '#Label1'; Hint := ''; @@ -350,7 +365,7 @@ begin with btnMaxDate do begin Name := 'btnMaxDate'; - SetPosition(232, 172, 75, 23); + SetPosition(232, 216, 75, 23); Text := 'Max Date'; FontDesc := '#Label1'; Hint := ''; @@ -366,6 +381,7 @@ begin SetPosition(128, 92, 236, 20); Checked := True; FontDesc := '#Label1'; + Hint := ''; TabOrder := 17; Text := 'Close combo on date selection'; OnChange := @cbCloseOnSelectChanged; @@ -385,11 +401,46 @@ begin with bvlName1 do begin Name := 'bvlName1'; - SetPosition(8, 204, 350, 2); + SetPosition(8, 248, 350, 2); Anchors := [anLeft,anRight,anTop]; + Hint := ''; Style := bsLowered; end; + CalendarCombo1 := TfpgCalendarCheckCombo.Create(self); + with CalendarCombo1 do + begin + Name := 'CalendarCombo1'; + SetPosition(132, 308, 120, 22); + Checked := True; + DateFormat := 'yyyy-mm-dd'; + FontDesc := '#List'; + Hint := ''; + TabOrder := 18; + end; + + Label1 := TfpgLabel.Create(self); + with Label1 do + begin + Name := 'Label1'; + SetPosition(8, 312, 116, 16); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Optional date:'; + end; + + cbSingleClickClose := TfpgCheckBox.Create(self); + with cbSingleClickClose do + begin + Name := 'cbSingleClickClose'; + SetPosition(128, 112, 236, 20); + FontDesc := '#Label1'; + Hint := ''; + TabOrder := 20; + Text := 'Single click selection'; + OnChange := @cbSingleClickCloseChanged; + end; + {@VFD_BODY_END: MainForm} end; diff --git a/examples/gui/colorwheel/frm_main.pas b/examples/gui/colorwheel/frm_main.pas index 3633b740..63518360 100644 --- a/examples/gui/colorwheel/frm_main.pas +++ b/examples/gui/colorwheel/frm_main.pas @@ -67,14 +67,14 @@ end; procedure TMainForm.RGBChanged(Sender: TObject); var - rgb: TRGBTriple; + rgb: TFPColor; c: TfpgColor; begin FViaRGB := True; // revent recursive updates rgb.Red := StrToInt(edR.Text); rgb.Green := StrToInt(edG.Text); rgb.Blue := StrToInt(edB.Text); - c := RGBTripleTofpgColor(rgb); + c := FPColorTofpgColor(rgb); ColorWheel1.SetSelectedColor(c); // This will trigger ColorWheel and ValueBar OnChange event FViaRGB := False; end; @@ -122,11 +122,11 @@ end; procedure TMainForm.UpdateRGBComponents; var - rgb: TRGBTriple; + rgb: TFPColor; c: TfpgColor; begin c := ValueBar1.SelectedColor; - rgb := fpgColorToRGBTriple(c); + rgb := fpgColorToFPColor(c); edR.Text := IntToStr(rgb.Red); edG.Text := IntToStr(rgb.Green); edB.Text := IntToStr(rgb.Blue); diff --git a/examples/gui/combobox/comboboxtest.lpi b/examples/gui/combobox/comboboxtest.lpi index 45eaa7c1..41f6ae73 100644 --- a/examples/gui/combobox/comboboxtest.lpi +++ b/examples/gui/combobox/comboboxtest.lpi @@ -1,15 +1,14 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> diff --git a/examples/gui/combobox/extrafpc.cfg b/examples/gui/combobox/extrafpc.cfg index 775d592f..07f6831a 100644 --- a/examples/gui/combobox/extrafpc.cfg +++ b/examples/gui/combobox/extrafpc.cfg @@ -1,5 +1,6 @@ -FUunits -Fu../../../lib/$fpctarget +-Fu../common/ -Xs -XX -CX diff --git a/examples/gui/common/randomdata.pas b/examples/gui/common/randomdata.pas index 94d8586a..0bb7ba93 100644 --- a/examples/gui/common/randomdata.pas +++ b/examples/gui/common/randomdata.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, diff --git a/examples/gui/embedded_form/demo1.lpi b/examples/gui/embedded_form/demo1.lpi new file mode 100644 index 00000000..f6200396 --- /dev/null +++ b/examples/gui/embedded_form/demo1.lpi @@ -0,0 +1,62 @@ +<?xml version="1.0"?> +<CONFIG> + <ProjectOptions> + <Version Value="7"/> + <General> + <Flags> + <SaveOnlyProjectUnits Value="True"/> + </Flags> + <SessionStorage Value="InProjectDir"/> + <MainUnit Value="0"/> + <TargetFileExt Value=""/> + <UseAppBundle Value="False"/> + </General> + <VersionInfo> + <ProjectVersion Value=""/> + </VersionInfo> + <PublishOptions> + <Version Value="2"/> + <IgnoreBinaries Value="False"/> + <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> + <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/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="3"> + <Unit0> + <Filename Value="demo1.lpr"/> + <IsPartOfProject Value="True"/> + <UnitName Value="demo1"/> + </Unit0> + <Unit1> + <Filename Value="fra_test.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="fra_test"/> + </Unit1> + <Unit2> + <Filename Value="frm_main.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="frm_main"/> + </Unit2> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="8"/> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)/"/> + </SearchPaths> + <Other> + <CustomOptions Value="-FUunits"/> + <CompilerPath Value="$(CompPath)"/> + </Other> + </CompilerOptions> +</CONFIG> diff --git a/examples/gui/embedded_form/demo1.lpr b/examples/gui/embedded_form/demo1.lpr new file mode 100644 index 00000000..c006d530 --- /dev/null +++ b/examples/gui/embedded_form/demo1.lpr @@ -0,0 +1,29 @@ +program demo1; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes, fpg_main, frm_main, fra_test; + + +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. + diff --git a/examples/gui/embedded_form/extrafpc.cfg b/examples/gui/embedded_form/extrafpc.cfg new file mode 100644 index 00000000..775d592f --- /dev/null +++ b/examples/gui/embedded_form/extrafpc.cfg @@ -0,0 +1,5 @@ +-FUunits +-Fu../../../lib/$fpctarget +-Xs +-XX +-CX diff --git a/examples/gui/embedded_form/fra_test.pas b/examples/gui/embedded_form/fra_test.pas new file mode 100644 index 00000000..184ee2da --- /dev/null +++ b/examples/gui/embedded_form/fra_test.pas @@ -0,0 +1,148 @@ +unit fra_test; + +{$mode objfpc}{$H+} + +interface + +uses + SysUtils, Classes, fpg_base, fpg_main, fpg_checkbox, fpg_button, + fpg_menu, fpg_memo, fpg_panel; + +type + + { Note the tags for the UI Designer. This allows use to visually design + our frame. } + TMyFrame = class(TfpgBevel) + private + {@VFD_HEAD_BEGIN: MyFrame} + fraCheckBox1: TfpgCheckBox; + fraMenu1: TfpgMenuBar; + Button1: TfpgButton; + Memo1: TfpgMemo; + {@VFD_HEAD_END: MyFrame} + framnuFile: TfpgPopupMenu; + framnuHelp: TfpgPopupMenu; + WindowTitle: TfpgString; + procedure miHelpAboutClicked(Sender: TObject); + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure AfterCreate; + end; + +{@VFD_NEWFORM_DECL} + +implementation + +uses + fpg_dialogs; + +{@VFD_NEWFORM_IMPL} + +procedure TMyFrame.miHelpAboutClicked(Sender: TObject); +begin + TfpgMessageDialog.AboutFPGui(''); +end; + +constructor TMyFrame.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + Shape := bsSpacer; + AfterCreate; +end; + +destructor TMyFrame.Destroy; +begin + framnuFile.Free; + framnuHelp.Free; + inherited Destroy; +end; + +procedure TMyFrame.AfterCreate; +var + miFile: TfpgMenuItem; + miHelp: TfpgMenuItem; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: MyFrame} + Name := 'MyFrame'; + SetPosition(380, 237, 200, 203); + WindowTitle := 'MyFrame'; + Hint := ''; + + fraCheckBox1 := TfpgCheckBox.Create(self); + with fraCheckBox1 do + begin + Name := 'fraCheckBox1'; + SetPosition(8, 40, 120, 20); + FontDesc := '#Label1'; + Hint := ''; + TabOrder := 0; + Text := 'CheckBox'; + end; + + fraMenu1 := TfpgMenuBar.Create(self); + with fraMenu1 do + begin + Name := 'fraMenu1'; + SetPosition(0, 0, 200, 24); + Anchors := [anLeft,anRight,anTop]; + miFile := AddMenuItem('File', nil); + AddMenuItem('Edit', nil).Enabled := False; + miHelp := AddMenuItem('Help', nil); + end; + + Button1 := TfpgButton.Create(self); + with Button1 do + begin + Name := 'Button1'; + SetPosition(104, 164, 80, 24); + Anchors := [anRight,anBottom]; + Text := 'Button'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 2; + end; + + Memo1 := TfpgMemo.Create(self); + with Memo1 do + begin + Name := 'Memo1'; + SetPosition(12, 60, 172, 88); + Anchors := [anLeft,anRight,anTop,anBottom]; + Hint := ''; + Lines.Add(''); + FontDesc := '#Edit1'; + TabOrder := 3; + end; + + {@VFD_BODY_END: MyFrame} + {%endregion} + + { There still seems to be a minor issue with Popup Menus used in a frame. So + for now the work around is to manually maintain the life of the Popup + Menus - so Owner is set to nil. } + framnuFile := TfpgPopupMenu.Create(nil); + with framnuFile do + begin + Name := 'framnuFile'; + SetPosition(44, 64, 120, 20); + AddMenuItem('Open...', '', nil); + AddMenuItem('-', '', nil); + AddMenuItem('Save', '', nil); + end; + miFile.SubMenu := framnuFile; + + framnuHelp := TfpgPopupMenu.Create(nil); + with framnuHelp do + begin + Name := 'framnuHelp'; + SetPosition(44, 64, 120, 20); + AddMenuItem('About fpGUI...', '', @miHelpAboutClicked); + end; + miHelp.SubMenu := framnuHelp; +end; + + +end. diff --git a/examples/gui/embedded_form/frm_main.pas b/examples/gui/embedded_form/frm_main.pas new file mode 100644 index 00000000..831385cc --- /dev/null +++ b/examples/gui/embedded_form/frm_main.pas @@ -0,0 +1,278 @@ +unit frm_main; + +{$mode objfpc}{$H+} + +interface + +uses + SysUtils, Classes, + fpg_base, fpg_main, fpg_form, fpg_panel, fpg_button, + fpg_checkbox, fra_test, fpg_menu; + +type + + TMainForm = class(TfpgForm) + private + {@VFD_HEAD_BEGIN: MainForm} + BorderBevel: TfpgBevel; + Container: TfpgBevel; + btnExternal: TfpgButton; + btnEmbed1: TfpgButton; + CheckBox1: TfpgCheckBox; + MainMenu: TfpgMenubar; + mnuFile: TfpgPopupMenu; + mnuHelp: TfpgPopupMenu; + btnEmbed2: TfpgButton; + {@VFD_HEAD_END: MainForm} + frame: TMyFrame; + procedure btnExternalClicked(Sender: TObject); + procedure btnEmbed1Clicked(Sender: TObject); + procedure btnEmbed2Clicked(Sender: TObject); + procedure CheckBoxChanged(Sender: TObject); + procedure miQuitClicked(Sender: TObject); + procedure miHelpAboutClicked(Sender: TObject); + public + procedure AfterCreate; override; + end; + +{@VFD_NEWFORM_DECL} + +implementation + +uses + fpg_widget, fpg_dialogs; + + +var + { manage indentation level } + indent: integer = 0; + +{ Output component hierarchy and status of each component's Visible property } +procedure PrintVisibleState(AComponent: TfpgWidget); +var + i: integer; + { Create string equal to indentation level } + function Spaces: string; + var + j: integer; + begin + if indent = 0 then + exit; + for j := 1 to indent do + Result := Result + ' '; + end; + +begin + writeln(Spaces + AComponent.ClassName + ' - [parent]: ' + BoolToStr(AComponent.Visible, True)); + Inc(indent, 2); + for i := 0 to AComponent.ComponentCount-1 do + begin + if AComponent.Components[i].ComponentCount > 0 then + PrintVisibleState(TfpgWidget(AComponent.Components[i])) + else + writeln(Spaces + AComponent.Components[i].ClassName + ': ' + BoolToStr(TfpgWidget(AComponent.Components[i]).Visible, True)); + end; + dec(indent, 2); +end; + + +{@VFD_NEWFORM_IMPL} + +procedure TMainForm.CheckBoxChanged(Sender: TObject); +begin + if Assigned(frame) then + begin + frame.Visible := Checkbox1.Checked; + writeln('Checkbox clicked...'); + PrintVisibleState(self); + end; +end; + +procedure TMainForm.miQuitClicked(Sender: TObject); +begin + Close; +end; + +procedure TMainForm.miHelpAboutClicked(Sender: TObject); +begin + TfpgMessageDialog.Information('Embedded Frame Demo', 'A simple demo showing how to embed frames') +end; + +procedure TMainForm.btnExternalClicked(Sender: TObject); +var + frm: TfpgForm; + fra: TMyFrame; +begin + { create a form at runtime that will hold our frame. } + frm := TfpgForm.Create(nil); + try + frm.WindowPosition := wpOneThirdDown; + frm.Width := 284; + frm.Height := 257; + + // embed the frame in the form + fra := TMyFrame.Create(frm); + fra.Align := alClient; + + frm.ShowModal; + finally + frm.Free; + end; +end; + +procedure TMainForm.btnEmbed1Clicked(Sender: TObject); +begin + if Assigned(frame) then + exit; + + frame := TMyFrame.Create(Container); + with frame do + begin + Name := 'frame'; + SetPosition(0, 0, 280, 196); + Shape := bsSpacer; + Align := alClient; + end; + PrintVisibleState(self); + + CheckBox1.Enabled := True; + CheckBox1.Checked := True; + btnEmbed2.Enabled := False; +end; + +procedure TMainForm.btnEmbed2Clicked(Sender: TObject); +begin + if Assigned(frame) then + exit; + + frame := TMyFrame.Create(Container); + with frame do + begin + Name := 'frame'; + SetPosition(0, 0, 280, 196); + Shape := bsSpacer; + Align := alClient; + Visible := False; + end; + PrintVisibleState(self); + + CheckBox1.Enabled := True; + CheckBox1.Checked := False; + btnEmbed1.Enabled := False; +end; + +procedure TMainForm.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: MainForm} + Name := 'MainForm'; + SetPosition(387, 207, 393, 340); + WindowTitle := 'MainForm'; + Hint := ''; + ShowHint := True; + + BorderBevel := TfpgBevel.Create(self); + with BorderBevel do + begin + Name := 'BorderBevel'; + SetPosition(0, 68, 393, 272); + Anchors := [anLeft,anRight,anTop,anBottom]; + Hint := ''; + Shape := bsSpacer; + end; + + Container := TfpgBevel.Create(BorderBevel); + with Container do + begin + Name := 'Container'; + SetPosition(8, 8, 377, 257); + Anchors := [anLeft,anRight,anTop,anBottom]; + Hint := ''; + Style := bsLowered; + Shape := bsSpacer; + end; + + btnExternal := TfpgButton.Create(self); + with btnExternal do + begin + Name := 'btnExternal'; + SetPosition(12, 40, 80, 24); + Text := 'External'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 1; + OnClick := @btnExternalClicked; + end; + + btnEmbed1 := TfpgButton.Create(self); + with btnEmbed1 do + begin + Name := 'btnEmbed1'; + SetPosition(96, 40, 80, 24); + Text := 'Embed 1'; + FontDesc := '#Label1'; + Hint := 'Create embedded Form with Visible = True (default behaviour)'; + ImageName := ''; + TabOrder := 2; + OnClick := @btnEmbed1Clicked; + end; + + CheckBox1 := TfpgCheckBox.Create(self); + with CheckBox1 do + begin + Name := 'CheckBox1'; + SetPosition(296, 40, 93, 20); + FontDesc := '#Label1'; + Hint := ''; + TabOrder := 4; + Text := 'Visible'; + Enabled := false; + OnChange := @CheckBoxChanged; + end; + + MainMenu := TfpgMenubar.Create(self); + with MainMenu do + begin + Name := 'MainMenu'; + SetPosition(0, 0, 393, 28); + Anchors := [anLeft,anRight,anTop]; + end; + + mnuFile := TfpgPopupMenu.Create(self); + with mnuFile do + begin + Name := 'mnuFile'; + SetPosition(156, 88, 120, 20); + AddMenuItem('Quit', '', @miQuitClicked); + end; + + mnuHelp := TfpgPopupMenu.Create(self); + with mnuHelp do + begin + Name := 'mnuHelp'; + SetPosition(156, 112, 120, 20); + AddMenuItem('About...', '', @miHelpAboutClicked); + end; + + btnEmbed2 := TfpgButton.Create(self); + with btnEmbed2 do + begin + Name := 'btnEmbed2'; + SetPosition(180, 40, 80, 24); + Text := 'Embed 2'; + FontDesc := '#Label1'; + Hint := 'Create embedded Form with Visible = False'; + ImageName := ''; + TabOrder := 7; + OnClick := @btnEmbed2Clicked; + end; + + {@VFD_BODY_END: MainForm} + {%endregion} + MainMenu.AddMenuItem('File', nil).SubMenu := mnuFile; + MainMenu.AddMenuItem('Help', nil).SubMenu := mnuHelp; +end; + + +end. diff --git a/examples/gui/embedded_form/units/.gitignore b/examples/gui/embedded_form/units/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/examples/gui/embedded_form/units/.gitignore @@ -0,0 +1 @@ +* diff --git a/examples/gui/filedialog/filedialog.lpi b/examples/gui/filedialog/filedialog.lpi index bd328806..2291e3f1 100644 --- a/examples/gui/filedialog/filedialog.lpi +++ b/examples/gui/filedialog/filedialog.lpi @@ -1,11 +1,11 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> diff --git a/examples/gui/filedialog/filedialog.lpr b/examples/gui/filedialog/filedialog.lpr index 676100cc..37f90ddf 100644 --- a/examples/gui/filedialog/filedialog.lpr +++ b/examples/gui/filedialog/filedialog.lpr @@ -55,7 +55,10 @@ type function TMyDBLoginDlg.GetDatabase: TfpgString; begin - Result := aStringList.ValueFromIndex[cbDatabases.FocusItem]; + if cbDatabases.FocusItem = -1 then + Result := '<nothing selected>' + else + Result := aStringList.ValueFromIndex[cbDatabases.FocusItem]; end; procedure TMyDBLoginDlg.PopulateComboDb; @@ -83,13 +86,13 @@ begin dlg := TMyDBLoginDlg.Create(nil); try dlg.WindowTitle := 'Sample Login'; - if dlg.ShowModal = 1 then + if dlg.ShowModal = mrOK then begin TfpgMessageDialog.Information('User Results', 'User=' + dlg.UserID + #13 + 'Pass=' + dlg.Password + #13 + 'Database=' + dlg.Database, [mbOK]); - fpgApplication.ProcessMessages; +// fpgApplication.ProcessMessages; end; finally dlg.Free; diff --git a/examples/gui/gauges/gaugetest.lpi b/examples/gui/gauges/gaugetest.lpi index 60994bb5..731e6f4d 100644 --- a/examples/gui/gauges/gaugetest.lpi +++ b/examples/gui/gauges/gaugetest.lpi @@ -1,15 +1,14 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=".exe"/> </General> <VersionInfo> diff --git a/examples/gui/gauges/gaugetest.lpr b/examples/gui/gauges/gaugetest.lpr index 3e7de4d4..d5ef47ab 100644 --- a/examples/gui/gauges/gaugetest.lpr +++ b/examples/gui/gauges/gaugetest.lpr @@ -72,7 +72,7 @@ begin Text := 'Close'; FontDesc := '#Label1'; ImageName := 'stdimg.close'; - ModalResult := 1; + ModalResult := mrOK; OnClick:= @OnCloseClick; end; diff --git a/examples/gui/gridtest/gridtest.lpi b/examples/gui/gridtest/gridtest.lpi index 25664143..8d6de301 100644 --- a/examples/gui/gridtest/gridtest.lpi +++ b/examples/gui/gridtest/gridtest.lpi @@ -1,18 +1,18 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="8"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> <TargetFileExt Value=""/> </General> <VersionInfo> - <ProjectVersion Value=""/> + <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> </VersionInfo> <PublishOptions> <Version Value="2"/> @@ -39,7 +39,12 @@ </Units> </ProjectOptions> <CompilerOptions> - <Version Value="8"/> + <Version Value="9"/> + <Parsing> + <SyntaxOptions> + <UseAnsiStrings Value="False"/> + </SyntaxOptions> + </Parsing> <Other> <CustomOptions Value="-FUunits "/> diff --git a/examples/gui/gridtest/gridtest.lpr b/examples/gui/gridtest/gridtest.lpr index 56afaa10..29a51b43 100644 --- a/examples/gui/gridtest/gridtest.lpr +++ b/examples/gui/gridtest/gridtest.lpr @@ -39,9 +39,9 @@ type btnAddOne: TfpgButton; btnFiveOnly: TfpgButton; btnDelRow: TfpgButton; + chkSmoothScroll: TfpgCheckBox; {@VFD_HEAD_END: MainForm} - procedure StringGridDoubleClicked(Sender: TObject; AButton: TMouseButton; - AShift: TShiftState; const AMousePos: TPoint); + procedure StringGridDoubleClicked(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); procedure btnAddFiveClicked(Sender: TObject); procedure btnAddOneClicked(Sender: TObject); procedure btnFiveOnlyClicked(Sender: TObject); @@ -51,6 +51,7 @@ type procedure chkShowHeaderChange(Sender: TObject); procedure chkShowGridChange(Sender: TObject); procedure chkHideFocusChange(Sender: TObject); + procedure chkSmoothScrollChange(Sender: TObject); procedure btnQuitClick(Sender: TObject); procedure stringgridDrawCell(Sender: TObject; const ARow, ACol: Integer; const ARect: TfpgRect; const AFlags: TfpgGridDrawState; var ADefaultDrawing: boolean); @@ -117,10 +118,19 @@ begin if chkHideFocus.Checked then stringgrid.Options := stringgrid.Options + [go_HideFocusRect] else - stringgrid.Options := []; + stringgrid.Options := stringgrid.Options - [go_HideFocusRect]; stringgrid.Invalidate; end; +procedure TMainForm.chkSmoothScrollChange(Sender: TObject); +begin + if chkSmoothScroll.Checked then + stringgrid.Options := stringgrid.Options + [go_SmoothScroll] + else + stringgrid.Options := stringgrid.Options - [go_SmoothScroll]; + stringgrid.Update; +end; + procedure TMainForm.btnQuitClick(Sender: TObject); begin Close; @@ -156,6 +166,7 @@ begin Name := 'MainForm'; SetPosition(351, 214, 515, 350); WindowTitle := 'Grid control test'; + Hint := ''; WindowPosition := wpScreenCenter; btnQuit := TfpgButton.Create(self); @@ -168,6 +179,7 @@ begin FontDesc := '#Label1'; Hint := ''; ImageName := 'stdimg.Quit'; + TabOrder := 1; OnClick := @btnQuitClick; end; @@ -182,7 +194,9 @@ begin AddColumn('Numbers', 150, taRightJustify); FontDesc := '#Grid'; HeaderFontDesc := '#GridHeader'; + Hint := ''; RowCount := 17; + RowSelect := False; TabOrder := 1; AddColumn('Column 0', 65); // Alignment test @@ -213,6 +227,7 @@ begin Anchors := [anRight,anTop]; Checked := True; FontDesc := '#Label1'; + Hint := ''; TabOrder := 2; Text := 'Show Header'; OnChange := @chkShowHeaderChange; @@ -226,6 +241,7 @@ begin Anchors := [anRight,anTop]; Checked := True; FontDesc := '#Label1'; + Hint := ''; TabOrder := 3; Text := 'Show Grid'; OnChange := @chkShowGridChange; @@ -238,6 +254,7 @@ begin SetPosition(394, 60, 116, 24); Anchors := [anRight,anTop]; FontDesc := '#Label1'; + Hint := ''; TabOrder := 4; Text := 'Row Select'; OnChange := @chkRowSelectChange; @@ -250,6 +267,7 @@ begin SetPosition(394, 84, 116, 24); Anchors := [anRight,anTop]; FontDesc := '#Label1'; + Hint := ''; TabOrder := 5; Text := 'Disabled'; OnChange := @chkDisabledChange; @@ -262,6 +280,7 @@ begin SetPosition(394, 108, 120, 20); Anchors := [anRight,anTop]; FontDesc := '#Label1'; + Hint := ''; TabOrder := 6; Text := 'Hide Focus'; OnChange := @chkHideFocusChange; @@ -271,8 +290,12 @@ begin with edtTopRow do begin Name := 'edtTopRow'; - SetPosition(12, 280, 56, 22); + SetPosition(12, 280, 56, 24); Anchors := [anLeft,anBottom]; + Hint := ''; + TabOrder := 8; + FontDesc := '#Edit1'; + Value := 0; end; btnTopRow := TfpgButton.Create(self); @@ -336,6 +359,7 @@ begin begin Name := 'btnDelRow'; SetPosition(168, 308, 80, 23); + Anchors := [anLeft,anBottom]; Text := 'Delete Row'; FontDesc := '#Label1'; Hint := ''; @@ -344,6 +368,19 @@ begin OnClick := @btnDelRowClicked; end; + chkSmoothScroll := TfpgCheckBox.Create(self); + with chkSmoothScroll do + begin + Name := 'chkSmoothScroll'; + SetPosition(394, 128, 120, 20); + Anchors := [anRight,anTop]; + FontDesc := '#Label1'; + Hint := ''; + TabOrder := 14; + Text := 'Smooth Scroll'; + OnChange := @chkSmoothScrollChange; + end; + {@VFD_BODY_END: MainForm} for r := 0 to stringgrid.RowCount-1 do diff --git a/examples/gui/hintwindow/hintwindowtest.lpi b/examples/gui/hintwindow/hintwindowtest.lpi index 312b1b3b..eef2ca11 100644 --- a/examples/gui/hintwindow/hintwindowtest.lpi +++ b/examples/gui/hintwindow/hintwindowtest.lpi @@ -1,11 +1,11 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> diff --git a/examples/gui/hintwindow/hintwindowtest.lpr b/examples/gui/hintwindow/hintwindowtest.lpr index 59319057..4b709dd2 100644 --- a/examples/gui/hintwindow/hintwindowtest.lpr +++ b/examples/gui/hintwindow/hintwindowtest.lpr @@ -11,9 +11,16 @@ uses fpg_radiobutton, fpg_listbox, fpg_checkbox, fpg_panel, fpg_hint; type + { A very simple custom hint window. } + TMyHintWindow = class(TfpgHintWindow) + private + procedure FormPaint(Sender: TObject); + public + constructor Create(AOwner: TComponent); override; + end; - { TMainForm } + { test application main form } TMainForm = class(TfpgForm) private function GetHintWnd: TfpgHintWindow; @@ -50,6 +57,8 @@ type procedure rb_bgcolor_blueChange(Sender: TObject); procedure rb_shadowcolor_grayChange(Sender: TObject); procedure rb_shadowcolor_blackChange(Sender: TObject); + procedure cbShadowChanged(Sender: TObject); + procedure chbCustomHintChanged(Sender: TObject); public {@VFD_HEAD_BEGIN: MainForm} lblName1: TfpgLabel; @@ -97,10 +106,12 @@ type rb_bgcolor_green: TfpgRadioButton; rb_bgcolor_blue: TfpgRadioButton; p_shadowcolor: TfpgPanel; + cbShadow: TfpgCheckBox; rb_shadowcolor_gray: TfpgRadioButton; rb_shadowcolor_black: TfpgRadioButton; chbShowHint: TfpgCheckBox; chbAppShowHint: TfpgCheckBox; + chbCustomHint: TfpgCheckBox; {@VFD_HEAD_END: MainForm} procedure AfterCreate; override; end; @@ -295,49 +306,49 @@ end; procedure TMainForm.rb_color_blackChange(Sender: TObject); begin if rb_color_black.Checked then - GetHintWnd.LTextColor := clBlack; + GetHintWnd.TextColor := clBlack; end; procedure TMainForm.rb_color_redChange(Sender: TObject); begin if rb_color_red.Checked then - GetHintWnd.LTextColor := clRed; + GetHintWnd.TextColor := clRed; end; procedure TMainForm.rb_color_greenChange(Sender: TObject); begin if rb_color_green.Checked then - GetHintWnd.LTextColor := clGreen; + GetHintWnd.TextColor := clGreen; end; procedure TMainForm.rb_color_blueChange(Sender: TObject); begin if rb_color_blue.Checked then - GetHintWnd.LTextColor := clBlue; + GetHintWnd.TextColor := clBlue; end; procedure TMainForm.rb_bgcolor_yellowChange(Sender: TObject); begin if rb_bgcolor_yellow.Checked then - GetHintWnd.LBackgroundColor := TfpgColor($ffffbf); //clYellow; + GetHintWnd.BackgroundColor := clHintWindow; end; procedure TMainForm.rb_bgcolor_whiteChange(Sender: TObject); begin if rb_bgcolor_white.Checked then - GetHintWnd.LBackgroundColor := clWhite; + GetHintWnd.BackgroundColor := clWhite; end; procedure TMainForm.rb_bgcolor_greenChange(Sender: TObject); begin if rb_bgcolor_green.Checked then - GetHintWnd.LBackgroundColor := clPaleGreen; + GetHintWnd.BackgroundColor := clPaleGreen; end; procedure TMainForm.rb_bgcolor_blueChange(Sender: TObject); begin if rb_bgcolor_blue.Checked then - GetHintWnd.LBackgroundColor := clLightBlue; + GetHintWnd.BackgroundColor := clLightBlue; end; procedure TMainForm.rb_shadowcolor_grayChange(Sender: TObject); @@ -352,6 +363,23 @@ begin GetHintWnd.ShadowColor := clBlack; end; +procedure TMainForm.cbShadowChanged(Sender: TObject); +begin + if cbShadow.Checked then + GetHintWnd.Shadow := 2 + else + GetHintWnd.Shadow := 0; +end; + +procedure TMainForm.chbCustomHintChanged(Sender: TObject); +begin + if chbCustomHint.Checked then + HintWindowClass := TMyHintWindow + else + HintWindowClass := TfpgHintWindow; + fpgApplication.RecreateHintWindow; +end; + procedure TMainForm.AfterCreate; begin {@VFD_BODY_BEGIN: MainForm} @@ -375,9 +403,15 @@ begin Name := 'edtText'; SetPosition(24, 28, 120, 22); TabOrder := 1; -// Text := 'Hello World!'; + Text := 'A very long hint'; FontDesc := '#Edit1'; - Hint := 'generic edit control' + Hint := 'generic edit control generic edit control generic edit control ' + + 'generic edit control generic edit control generic edit control ' + + 'generic edit control generic edit control generic edit control ' + + 'generic edit control generic edit control generic edit control ' + + 'generic edit control generic edit control generic edit control ' + + 'generic edit control generic edit control generic edit control ' + + 'generic edit control. The end.'; end; chbPasswd := TfpgCheckBox.Create(self); @@ -452,7 +486,7 @@ begin SetPosition(24, 108, 120, 22); ShowThousand := True; CustomThousandSeparator := ','; - onChange := @edtIntegerChange; + OnChange := @edtIntegerChange; Hint := 'integer edit control'; end; @@ -463,7 +497,7 @@ begin SetPosition(24, 164, 120, 22); ShowThousand := True; CustomThousandSeparator := ','; - onChange := @edtFloatChange; + OnChange := @edtFloatChange; Hint := 'float edit control'; end; @@ -476,7 +510,7 @@ begin CustomThousandSeparator := ','; // Decimals := 2; Value := -123.45; - onChange := @edtCurrencyChange; + OnChange := @edtCurrencyChange; Hint := 'currency edit control'; end; @@ -624,8 +658,8 @@ begin rb_time_3.OnChange:= @rb_time_3Change; rb_time_5 := CreateRadioButton(p_time,80,50,'5 seconds'); - rb_time_5.Checked:= True; rb_time_5.OnChange:= @rb_time_5Change; + rb_time_5.Checked:= True; p_color := TfpgPanel.Create(self); with p_color do @@ -660,7 +694,7 @@ begin Text := 'Hint background color'; end; - rb_bgcolor_yellow := CreateRadioButton(p_bgcolor,10,25,'Yellow'); + rb_bgcolor_yellow := CreateRadioButton(p_bgcolor,10,25,'Default'); rb_bgcolor_yellow.Checked:= True; rb_bgcolor_yellow.OnChange:= @rb_bgcolor_yellowChange; @@ -677,27 +711,33 @@ begin with p_shadowcolor do begin name := 'p_shadowcolor'; - SetPosition(200,440,180,50); + SetPosition(200,440,180,80); Layout := tlTop; FontDesc := '#Label1'; Text := 'Shadow color'; end; - rb_shadowcolor_gray := CreateRadioButton(p_shadowcolor,10,25,'Gray'); + cbShadow := CreateCheckBox(p_shadowcolor, 10, 25, 'Show Hint Shadow'); + cbShadow.OnChange := @cbShadowChanged; + + rb_shadowcolor_gray := CreateRadioButton(p_shadowcolor,10,50,'Gray'); rb_shadowcolor_gray.Checked:= True; rb_shadowcolor_gray.OnChange:= @rb_shadowcolor_grayChange; - rb_shadowcolor_black := CreateRadioButton(p_shadowcolor,80,25,'Black'); + rb_shadowcolor_black := CreateRadioButton(p_shadowcolor,80,50,'Black'); rb_shadowcolor_black.OnChange:= @rb_shadowcolor_blackChange; - chbShowHint := CreateCheckBox(Self,200,495,'Form.ShowHint'); + chbShowHint := CreateCheckBox(Self,10,520,'Form.ShowHint'); chbShowHint.Checked := self.ShowHint; chbShowhint.OnChange:= @chbShowHintChange; - chbAppShowHint := CreateCheckBox(Self,200,515,'Application.ShowHint'); + chbAppShowHint := CreateCheckBox(Self,10,540,'Application.ShowHint'); chbAppShowHint.Checked := fpgApplication.ShowHint; chbAppShowhint.OnChange:= @chbAppShowHintChange; + chbCustomHint := CreateCheckBox(self, 200, 520, 'Custom Hint Window'); + chbCustomHint.OnChange := @chbCustomHintChanged; + {@VFD_BODY_END: MainForm} if edtFloat.CustomDecimalSeparator = '.' then @@ -707,20 +747,33 @@ begin end; -type - { A very simple custom hint window. } - TMyHintWindow = class(TfpgHintWindow) - public - constructor Create(AOwner: TComponent); override; - end; - { TMyHintWindow } +{ Not so efficient, but good enough for this demo } +procedure TMyHintWindow.FormPaint(Sender: TObject); +var + img: TfpgImage; + r: TfpgRect; +begin + r := GetClientRect; + InflateRect(r, -Border, -Border); + Canvas.GradientFill(r, clLavender, clWhite, gdVertical); + img := fpgImages.GetImage('stdimg.dlg.info'); + Canvas.TextColor := clMagenta; + Canvas.DrawImage(10, 10, img); + Canvas.DrawText(img.Width + 10, 10+(img.Height div 2), 'I am a custom hint window'); + Canvas.TextColor := TextColor; + Canvas.DrawText(GetClientRect, Text, [txtVCenter, txtHCenter, txtWrap]); + Canvas.DrawButtonFace(300, 165, 90, 25, []); +end; + constructor TMyHintWindow.Create(AOwner: TComponent); begin inherited Create(AOwner); + OnPaint := @FormPaint; MinWidth := 400; MinHeight := 200; + Border := 2; end; diff --git a/examples/gui/imgtest/bitmaptest.lpi b/examples/gui/imgtest/bitmaptest.lpi index af74913a..ec9a5f70 100644 --- a/examples/gui/imgtest/bitmaptest.lpi +++ b/examples/gui/imgtest/bitmaptest.lpi @@ -1,20 +1,19 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> <Title Value="bitmaptest"/> </General> <VersionInfo> - <ProjectVersion Value=""/> + <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> </VersionInfo> <PublishOptions> <Version Value="2"/> diff --git a/examples/gui/imgtest/bitmaptest.lpr b/examples/gui/imgtest/bitmaptest.lpr index 010ff886..898b7c61 100644 --- a/examples/gui/imgtest/bitmaptest.lpr +++ b/examples/gui/imgtest/bitmaptest.lpr @@ -19,8 +19,7 @@ type TMainForm = class(TfpgForm) private img: TfpgImage; - protected - procedure HandlePaint; override; + procedure FormPaint(Sender: TObject); public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -29,22 +28,21 @@ type { TMainForm } -procedure TMainForm.HandlePaint; +procedure TMainForm.FormPaint(Sender: TObject); var i, j: integer; begin - Canvas.BeginDraw; // activate double buffering in time. -// inherited HandlePaint; - img.Free; - img := TfpgImage.Create; - img.AllocateImage(32, 256, 256); - img.UpdateImage; - // populate the bitmap with pretty colors :-) - for j := 0 to 255 do - for i := 0 to 255 do - PLongWord(img.ImageData)[j * 256 + i] := (i shl 16) or (j shl 8); + if not Assigned(img) then // we only need to create the image once + begin + img := TfpgImage.Create; + img.AllocateImage(32, 256, 256); + // populate the bitmap with pretty colors :-) + for j := 0 to 255 do + for i := 0 to 255 do + PLongWord(img.ImageData)[j * 256 + i] := (i shl 16) or (j shl 8); + img.UpdateImage; // now only do we allocate OS resources + end; Canvas.DrawImage(0, 0, img); - Canvas.EndDraw; end; constructor TMainForm.Create(AOwner: TComponent); @@ -52,6 +50,9 @@ begin inherited Create(AOwner); SetPosition(100, 100, 256, 256); WindowTitle := 'fpGUI Bitmap Test'; + WindowPosition := wpOneThirdDown; + Sizeable := False; + OnPaint := @FormPaint; end; destructor TMainForm.Destroy; diff --git a/examples/gui/imgtest_jpeg/extrafpc.cfg b/examples/gui/imgtest_jpeg/extrafpc.cfg new file mode 100644 index 00000000..775d592f --- /dev/null +++ b/examples/gui/imgtest_jpeg/extrafpc.cfg @@ -0,0 +1,5 @@ +-FUunits +-Fu../../../lib/$fpctarget +-Xs +-XX +-CX diff --git a/examples/gui/imgtest_jpeg/jpeg.lpi b/examples/gui/imgtest_jpeg/jpeg.lpi new file mode 100644 index 00000000..6b0fc630 --- /dev/null +++ b/examples/gui/imgtest_jpeg/jpeg.lpi @@ -0,0 +1,73 @@ +<?xml version="1.0"?> +<CONFIG> + <ProjectOptions> + <Version Value="7"/> + <General> + <Flags> + <SaveOnlyProjectUnits Value="True"/> + <MainUnitHasCreateFormStatements Value="False"/> + <MainUnitHasTitleStatement Value="False"/> + <UseDefaultCompilerOptions Value="True"/> + </Flags> + <SessionStorage Value="InProjectDir"/> + <MainUnit Value="0"/> + <TargetFileExt Value=""/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <VersionInfo> + <Language Value=""/> + <CharSet Value=""/> + <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> + </VersionInfo> + <PublishOptions> + <Version Value="2"/> + <IgnoreBinaries Value="False"/> + <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> + <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/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="2"> + <Unit0> + <Filename Value="jpeg.lpr"/> + <IsPartOfProject Value="True"/> + </Unit0> + <Unit1> + <Filename Value="main.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="main"/> + </Unit1> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="8"/> + <SearchPaths> + <UnitOutputDirectory Value="units"/> + </SearchPaths> + <Parsing> + <SyntaxOptions> + <UseAnsiStrings Value="True"/> + </SyntaxOptions> + </Parsing> + <Other> + <CompilerPath Value="$(CompPath)"/> + </Other> + </CompilerOptions> + <Debugging> + <Exceptions Count="1"> + <Item1> + <Name Value="EDatabaseError"/> + </Item1> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/examples/gui/imgtest_jpeg/jpeg.lpr b/examples/gui/imgtest_jpeg/jpeg.lpr new file mode 100644 index 00000000..00c5fbd5 --- /dev/null +++ b/examples/gui/imgtest_jpeg/jpeg.lpr @@ -0,0 +1,24 @@ +program jpeg; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes, fpg_main, main; + +procedure MainProc; +begin + fpgApplication.Initialize; + frmMain := TfrmMain.Create(nil); + frmMain.Show; + fpgApplication.Run; + frmMain.Free; +end; + +begin + MainProc; +end. + + diff --git a/examples/gui/imgtest_jpeg/main.pas b/examples/gui/imgtest_jpeg/main.pas new file mode 100644 index 00000000..3525045e --- /dev/null +++ b/examples/gui/imgtest_jpeg/main.pas @@ -0,0 +1,206 @@ +unit main; + +{$mode objfpc}{$H+} + +interface + +uses + SysUtils, Classes, fpg_base, fpg_main, fpg_form, fpg_panel, fpg_button, + fpg_radiobutton, fpg_dialogs, fpg_imgfmt_jpg; + +type + + TfrmMain = class(TfpgForm) + private + {@VFD_HEAD_BEGIN: frmMain} + Panel1: TfpgPanel; + RadioButton1: TfpgRadioButton; + RadioButton2: TfpgRadioButton; + RadioButton3: TfpgRadioButton; + RadioButton4: TfpgRadioButton; + Button1: TfpgButton; + Button2: TfpgButton; + {@VFD_HEAD_END: frmMain} + FImage: TfpgImage; + FImageName: string; + SizeSelect: integer; + procedure Btn1Click(Sender: TObject); + procedure Btn2Click(Sender: TObject); + procedure rbChanged(Sender: TObject); + procedure FormPaint(Sender: TObject); + procedure LoadImage; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure AfterCreate; override; + end; + +{@VFD_NEWFORM_DECL} + var frmMain: TfrmMain; + +implementation + +{@VFD_NEWFORM_IMPL} + +procedure TfrmMain.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: frmMain} + Name := 'frmMain'; + SetPosition(321, 289, 330, 380); + WindowTitle := 'JPEG Image Test'; + WindowPosition := wpOneThirdDown; + Hint := ''; + + Panel1 := TfpgPanel.Create(self); + with Panel1 do + begin + Name := 'Panel1'; + SetPosition(16, 260, 96, 112); + FontDesc := '#Label1'; + Hint := ''; + Text := ''; + end; + + RadioButton1 := TfpgRadioButton.Create(Panel1); + with RadioButton1 do + begin + Name := 'RadioButton1'; + SetPosition(8, 8, 80, 20); + Checked := True; + FontDesc := '#Label1'; + GroupIndex := 0; + Hint := ''; + TabOrder := 1; + Text := 'Full size'; + Tag:=1; + OnChange := @rbChanged; + end; + + RadioButton2 := TfpgRadioButton.Create(Panel1); + with RadioButton2 do + begin + Name := 'RadioButton2'; + SetPosition(8, 32, 72, 20); + FontDesc := '#Label1'; + GroupIndex := 0; + Hint := ''; + TabOrder := 1; + Text := '1/2 size'; + Tag:=2; + OnChange := @rbChanged; + end; + + RadioButton3 := TfpgRadioButton.Create(Panel1); + with RadioButton3 do + begin + Name := 'RadioButton3'; + SetPosition(8, 56, 72, 20); + FontDesc := '#Label1'; + GroupIndex := 0; + Hint := ''; + TabOrder := 2; + Text := '1/4 size'; + Tag:=3; + OnChange := @rbChanged; + end; + + RadioButton4 := TfpgRadioButton.Create(Panel1); + with RadioButton4 do + begin + Name := 'RadioButton4'; + SetPosition(8, 80, 72, 20); + FontDesc := '#Label1'; + GroupIndex := 0; + Hint := ''; + TabOrder := 3; + Text := '1/8 size'; + Tag:=4; + OnChange := @rbChanged; + end; + + Button1 := TfpgButton.Create(self); + with Button1 do + begin + Name := 'Button1'; + SetPosition(216, 260, 80, 24); + Text := 'Open'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 2; + OnClick:=@Btn1Click; + end; + + Button2 := TfpgButton.Create(self); + with Button2 do + begin + Name := 'Button2'; + SetPosition(216, 304, 80, 24); + Text := 'Close'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 3; + OnClick:=@Btn2Click; + end; + + {@VFD_BODY_END: frmMain} + {%endregion} +end; + +procedure TfrmMain.LoadImage; +begin + WindowTitle := FImageName; + FImage := LoadImage_JPG(FImageName, SizeSelect); + RePaint; +end; + +constructor TfrmMain.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + OnPaint := @FormPaint; + SizeSelect := 1; // full size by default +end; + +destructor TfrmMain.Destroy; +begin + FImage.Free; + inherited Destroy; +end; + +procedure TfrmMain.Btn1Click(Sender: TObject); +var + dlg: TfpgFileDialog; +begin + dlg := TfpgFileDialog.Create(nil); + try + dlg.Filter := 'JPEG Image (*.jpg)|*.jpg'; + if dlg.RunOpenFile then + begin + FImageName:= dlg.FileName; + end; + finally + dlg.Free; + end; + LoadImage; +end; + +procedure TfrmMain.Btn2Click(Sender: TObject); +begin + Close; +end; + +procedure TfrmMain.FormPaint(Sender: TObject); +begin + Canvas.DrawImage(0, 0, FImage); +end; + +procedure TfrmMain.rbChanged(Sender: TObject); +begin + if Sender is TfpgRadioButton then + SizeSelect := TfpgRadioButton(Sender).Tag; + LoadImage; +end; + +end. diff --git a/examples/gui/imgtest_jpeg/poppy.jpg b/examples/gui/imgtest_jpeg/poppy.jpg Binary files differnew file mode 100644 index 00000000..367efe30 --- /dev/null +++ b/examples/gui/imgtest_jpeg/poppy.jpg diff --git a/examples/gui/imgtest_jpeg/poppygray.jpg b/examples/gui/imgtest_jpeg/poppygray.jpg Binary files differnew file mode 100644 index 00000000..0a9b4d20 --- /dev/null +++ b/examples/gui/imgtest_jpeg/poppygray.jpg diff --git a/examples/gui/imgtest_jpeg/poppyprogressif.jpg b/examples/gui/imgtest_jpeg/poppyprogressif.jpg Binary files differnew file mode 100644 index 00000000..2147ed64 --- /dev/null +++ b/examples/gui/imgtest_jpeg/poppyprogressif.jpg diff --git a/examples/gui/imgtest_jpeg/units/.gitignore b/examples/gui/imgtest_jpeg/units/.gitignore new file mode 100644 index 00000000..f59ec20a --- /dev/null +++ b/examples/gui/imgtest_jpeg/units/.gitignore @@ -0,0 +1 @@ +*
\ No newline at end of file diff --git a/examples/gui/memo/memotest.lpi b/examples/gui/memo/memotest.lpi index 51f39bef..0102fcfc 100644 --- a/examples/gui/memo/memotest.lpi +++ b/examples/gui/memo/memotest.lpi @@ -1,15 +1,14 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> @@ -24,7 +23,7 @@ <RunParams> <local> <FormatVersion Value="1"/> - <LaunchingApplication Use="True" PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> </local> </RunParams> <RequiredPackages Count="1"> @@ -42,11 +41,9 @@ </ProjectOptions> <CompilerOptions> <Version Value="8"/> - <Linking> - <Debugging> - <GenGProfCode Value="True"/> - </Debugging> - </Linking> + <SearchPaths> + <UnitOutputDirectory Value="units"/> + </SearchPaths> <Other> <CompilerPath Value="$(CompPath)"/> </Other> diff --git a/examples/gui/memo/memotest.lpr b/examples/gui/memo/memotest.lpr index 31f5799f..d38a4f95 100644 --- a/examples/gui/memo/memotest.lpr +++ b/examples/gui/memo/memotest.lpr @@ -12,86 +12,68 @@ uses fpg_main, fpg_form, fpg_button, - fpg_label, fpg_memo; type - - { TMainForm } - TMainForm = class(TfpgForm) private + {@VFD_HEAD_BEGIN: MainForm} memo: TfpgMemo; btnQuit: TfpgButton; - procedure btnQuitClick(Sender: TObject); - procedure HandleResize(awidth, aheight: TfpgCoord); override; + {@VFD_HEAD_END: MainForm} + procedure btnQuitClicked(Sender: TObject); public - constructor Create(AOwner: TComponent); override; + procedure AfterCreate; override; end; { TMainForm } -procedure TMainForm.btnQuitClick(Sender: TObject); +procedure TMainForm.btnQuitClicked(Sender: TObject); begin Close; end; -procedure TMainForm.HandleResize(awidth, aheight: TfpgCoord); +procedure TMainForm.AfterCreate; begin - inherited HandleResize(awidth, aheight); - if Assigned(Memo) then + {@VFD_BODY_BEGIN: MainForm} + Name := 'MainForm'; + SetPosition(329, 251, 300, 201); + WindowTitle := 'Memo Test'; + WindowPosition := wpOneThirdDown; + + memo := TfpgMemo.Create(self); + with memo do begin - Memo.SetPosition(Memo.Left, Memo.Top, awidth-20, aheight- Memo.Top - 10); - btnQuit.Left := awidth - btnQuit.Width - 10; - btnQuit.UpdateWindowPosition; + Name := 'memo'; + SetPosition(10, 40, 280, 150); + Anchors := [anLeft,anRight,anTop,anBottom]; + Lines.Add('Memo Test0'); + Lines.Add('Memo Test1'); + Lines.Add('Memo Test2'); + Lines.Add('Memo Test3'); + Lines.Add('Memo Test4'); + FontDesc := '#Edit1'; + TabOrder := 0; + Lines.Insert(1, '0 Before 1 after'); end; -end; - -constructor TMainForm.Create(AOwner: TComponent); -begin - inherited Create(AOwner); - WindowTitle := 'Memo test'; - SetPosition(100, 100, 300, 300); - memo := CreateMemo(self, 10, 40, 280, 150); - - memo.Lines.Add('Memo Test0'); - memo.Lines.Add('Memo Test1'); - memo.Lines.Add('Memo Test2'); - memo.Lines.Add('Memo Test3'); - memo.Lines.Add('Memo Test4'); - memo.Lines.Insert(1,'0 Before 1 after'); - //memo.Lines.Delete(1); - //memo.Lines.Text := 'Dude'+LineEnding+'What''s mine say?'+LineEnding;; - //memo.Lines.Text := memo.Lines.Text + 'Sweet'+LineEnding; - //memo.lines.LoadFromFile('/home/andrew/programming/groupprojects/fpgui/src/gui/fpg_memo.pas'); - //memo.lines.LoadFromFile('/usr/share/dict/cracklib-small'); - {memo.lines.Add(memo.lines.text); - memo.lines.Add(memo.lines.text); - memo.lines.Add(memo.lines.text); - memo.lines.Add(memo.lines.text);} - {memo.lines.Add(memo.lines.text); - memo.lines.Add(memo.lines.text); - memo.lines.Add(memo.lines.text); - memo.lines.Add(memo.lines.text); - memo.lines.Add(memo.lines.text); - memo.lines.Add(memo.lines.text);} - {memo.lines.Add(memo.lines.text); - memo.lines.Add(memo.lines.text); - memo.lines.Add(memo.lines.text);} - { memo.Lines.Text := memo.Lines.Text + memo.Lines.Text; - memo.Lines.Text := memo.Lines.Text + memo.Lines.Text; - memo.Lines.Text := memo.Lines.Text + memo.Lines.Text; - memo.Lines.Text := memo.Lines.Text + memo.Lines.Text; - memo.Lines.Text := memo.Lines.Text + memo.Lines.Text; - memo.Lines.Text := memo.Lines.Text + memo.Lines.Text; } - btnQuit := CreateButton(self, 210, 10, 80, 'Quit', @btnQuitClick); - btnQuit.ImageName := 'stdimg.quit'; - btnQuit.ShowImage := True; - - HandleResize(Width, Height); + btnQuit := TfpgButton.Create(self); + with btnQuit do + begin + Name := 'btnQuit'; + SetPosition(208, 8, 80, 24); + Anchors := [anRight,anTop]; + Text := 'Quit'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := 'stdimg.quit'; + TabOrder := 1; + OnClick := @btnQuitClicked; + end; + {@VFD_BODY_END: MainForm} end; + procedure MainProc; var frm: TMainForm; diff --git a/examples/gui/menutest/menutest.lpi b/examples/gui/menutest/menutest.lpi index f3d307af..522b9451 100644 --- a/examples/gui/menutest/menutest.lpi +++ b/examples/gui/menutest/menutest.lpi @@ -1,19 +1,18 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> - <ProjectVersion Value=""/> + <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> </VersionInfo> <PublishOptions> <Version Value="2"/> @@ -45,6 +44,11 @@ <Debugging> <GenerateDebugInfo Value="True"/> </Debugging> + <Options> + <Win32> + <GraphicApplication Value="True"/> + </Win32> + </Options> </Linking> <Other> <CustomOptions Value="-FUunits diff --git a/examples/gui/menutest/menutest.lpr b/examples/gui/menutest/menutest.lpr index 1db064fb..e4d40cf0 100644 --- a/examples/gui/menutest/menutest.lpr +++ b/examples/gui/menutest/menutest.lpr @@ -7,24 +7,44 @@ uses cthreads, {$ENDIF}{$ENDIF} Classes, + fpg_base, fpg_main, fpg_form, fpg_menu, - fpg_edit; + fpg_edit, + fpg_panel, + fpg_button, + fpg_dialogs, + fpg_memo; type TMainForm = class(TfpgForm) private + {@VFD_HEAD_BEGIN: MainForm} FMenuBar: TfpgMenuBar; + StatusBar: TfpgPanel; + Toolbar: TfpgBevel; + btnQuit: TfpgButton; + btnSave: TfpgButton; + btnOpen: TfpgButton; + btnAbout: TfpgButton; + edit1: TfpgEdit; + Memo1: TfpgMemo; FFileSubMenu: TfpgPopupMenu; FEditSubMenu: TfpgPopupMenu; FEditSelectSubMenu: TfpgPopupMenu; + FViewSubMenu: TfpgPopupMenu; FHelpSubMenu: TfpgPopupMenu; - edit1: TfpgEdit; + {@VFD_HEAD_END: MainForm} procedure miExitClicked(Sender: TObject); procedure miMenuItemSelected(Sender: TObject); + procedure miMenuItemChecked(Sender: TObject); + procedure miToolBarChecked(Sender: TObject); + procedure miStatusBarChecked(Sender: TObject); + procedure btnAboutClicked(Sender: TObject); + procedure Log(const AText: TfpgString); public - constructor Create(AOwner: TComponent); override; + procedure AfterCreate; override; end; @@ -38,52 +58,233 @@ end; procedure TMainForm.miMenuItemSelected(Sender: TObject); begin if Sender is TfpgMenuItem then - writeln('Menu clicked: ', TfpgMenuItem(Sender).Text); + Log('Menu clicked: ' + TfpgMenuItem(Sender).Text); +end; + +procedure TMainForm.miMenuItemChecked(Sender: TObject); +begin + TfpgMenuItem(Sender).Checked := not TfpgMenuItem(Sender).Checked; + Log('Check Menu item toggled'); +end; + +procedure TMainForm.miToolBarChecked(Sender: TObject); +begin + TfpgMenuItem(Sender).Checked := not TfpgMenuItem(Sender).Checked; + ToolBar.Visible := not ToolBar.Visible; + Log('Check Menu for Toolbar toggled'); +end; + +procedure TMainForm.miStatusBarChecked(Sender: TObject); +begin + TfpgMenuItem(Sender).Checked := not TfpgMenuItem(Sender).Checked; + StatusBar.Visible := not StatusBar.Visible; + Log('Check Menu for Statusbar toggled'); +end; + +procedure TMainForm.btnAboutClicked(Sender: TObject); +begin + TfpgMessageDialog.AboutFPGui; +end; + +procedure TMainForm.Log(const AText: TfpgString); +begin + Memo1.Lines.Add(AText); end; -constructor TMainForm.Create(AOwner: TComponent); +procedure TMainForm.AfterCreate; begin - inherited Create(AOwner); + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: MainForm} + Name := 'MainForm'; + SetPosition(316, 169, 400, 200); WindowTitle := 'Menu Test'; - WindowPosition := wpUser; - SetPosition(100, 100, 400, 200); - - // Create top level sub-menus + Hint := ''; + WindowPosition := wpOneThirdDown; + + FMenuBar := TfpgMenuBar.Create(self); + with FMenuBar do + begin + Name := 'FMenuBar'; + SetPosition(0, 0, 400, 24); + Anchors := [anLeft,anRight,anTop]; + end; + + StatusBar := TfpgPanel.Create(self); + with StatusBar do + begin + Name := 'StatusBar'; + SetPosition(0, 176, 400, 24); + Anchors := [anLeft,anRight,anBottom]; + Alignment := taLeftJustify; + FontDesc := '#Label1'; + Hint := ''; + Style := bsLowered; + Text := 'This is the status bar...'; + end; + + Toolbar := TfpgBevel.Create(self); + with Toolbar do + begin + Name := 'Toolbar'; + SetPosition(0, 24, 400, 29); + Anchors := [anLeft,anRight,anTop]; + Hint := ''; + Shape := bsBottomLine; + end; + + btnQuit := TfpgButton.Create(Toolbar); + with btnQuit do + begin + Name := 'btnQuit'; + SetPosition(4, 2, 24, 24); + Text := ''; + Embedded := True; + FontDesc := '#Label1'; + Hint := ''; + ImageMargin := -1; + ImageName := 'stdimg.quit'; + ImageSpacing := 0; + TabOrder := 1; + OnClick := @miExitClicked; + end; + + btnSave := TfpgButton.Create(Toolbar); + with btnSave do + begin + Name := 'btnSave'; + SetPosition(56, 2, 24, 24); + Text := ''; + Embedded := True; + FontDesc := '#Label1'; + Hint := ''; + ImageMargin := -1; + ImageName := 'stdimg.save'; + ImageSpacing := 0; + TabOrder := 2; + end; + + btnOpen := TfpgButton.Create(Toolbar); + with btnOpen do + begin + Name := 'btnOpen'; + SetPosition(32, 2, 24, 24); + Text := ''; + Embedded := True; + FontDesc := '#Label1'; + Hint := ''; + ImageMargin := -1; + ImageName := 'stdimg.open'; + ImageSpacing := 0; + TabOrder := 3; + end; + + btnAbout := TfpgButton.Create(Toolbar); + with btnAbout do + begin + Name := 'btnAbout'; + SetPosition(84, 2, 24, 24); + Text := ''; + Embedded := True; + FontDesc := '#Label1'; + Hint := ''; + ImageMargin := -1; + ImageName := 'stdimg.help'; + ImageSpacing := 0; + TabOrder := 4; + OnClick := @btnAboutClicked; + end; + + edit1 := TfpgEdit.Create(self); + with edit1 do + begin + Name := 'edit1'; + SetPosition(8, 62, 100, 24); + ExtraHint := ''; + Hint := ''; + TabOrder := 6; + Text := ''; + FontDesc := '#Edit1'; + end; + + Memo1 := TfpgMemo.Create(self); + with Memo1 do + begin + Name := 'Memo1'; + SetPosition(124, 60, 268, 108); + Anchors := [anLeft,anRight,anTop,anBottom]; + Hint := ''; + Lines.Add('<= Text Edit has a popup menu too.'); + FontDesc := '#Edit1'; + TabOrder := 10; + end; + FFileSubMenu := TfpgPopupMenu.Create(self); - FFileSubMenu.AddMenuItem('&Open', 'Ctrl-O', @miMenuItemSelected); - FFileSubMenu.AddMenuItem('&Save', 'Ctrl-S', @miMenuItemSelected); - FFileSubMenu.AddMenuItem('S&ave As', 'Ctrl+Shift+S', @miMenuItemSelected); - FFileSubMenu.AddMenuItem('-', '', nil); - FFileSubMenu.AddMenuItem('Save && Reload', '', @miMenuItemSelected); - FFileSubMenu.AddMenuItem('-', '', nil); - FFileSubMenu.AddMenuItem('&Quit', 'Ctrl-Q', @miExitClicked); + with FFileSubMenu do + begin + Name := 'FFileSubMenu'; + SetPosition(264, 60, 120, 20); + AddMenuItem('&Open', 'Ctrl-O', @miMenuItemSelected); + AddMenuItem('&Save', 'Ctrl-S', @miMenuItemSelected); + AddMenuItem('S&ave As', 'Ctrl+Shift+S', @miMenuItemSelected); + AddMenuItem('-', '', nil); + AddMenuItem('Save && Reload', '', @miMenuItemSelected); + AddMenuItem('-', '', nil); + AddMenuItem('&Quit', 'Ctrl-Q', @miExitClicked); + end; FEditSubMenu := TfpgPopupMenu.Create(self); - FEditSubMenu.AddMenuItem('&Cut', 'Ctrl-X', @miMenuItemSelected); - FEditSubMenu.AddMenuItem('C&opy', 'Ctrl-C', @miMenuItemSelected); - FEditSubMenu.AddMenuItem('&Paste', 'Ctrl-V', @miMenuItemSelected); - FEditSubMenu.AddMenuItem('-', '', nil); - FEditSubMenu.AddMenuItem('&Spell check', 'F4', @miMenuItemSelected).Enabled := False; + with FEditSubMenu do + begin + Name := 'FEditSubMenu'; + SetPosition(264, 80, 120, 20); + AddMenuItem('&Cut', 'Ctrl-X', @miMenuItemSelected); + AddMenuItem('C&opy', 'Ctrl-C', @miMenuItemSelected); + AddMenuItem('&Paste', 'Ctrl-V', @miMenuItemSelected); + AddMenuItem('-', '', nil); + AddMenuItem('&Spell check', 'F4', @miMenuItemSelected).Enabled := False; + end; + FEditSelectSubMenu := TfpgPopupMenu.Create(self); - FEditSubMenu.AddMenuItem('Selec&t', '', nil).SubMenu := FEditSelectSubMenu; - FEditSelectSubMenu.AddMenuItem('Select All', '', @miMenuItemSelected); - FEditSelectSubMenu.AddMenuItem('Select Word', '', @miMenuItemSelected); - FEditSelectSubMenu.AddMenuItem('Select Line', '', @miMenuItemSelected); + with FEditSelectSubMenu do + begin + Name := 'FEditSelectSubMenu'; + SetPosition(264, 100, 120, 20); + AddMenuItem('Select All', '', @miMenuItemSelected); + AddMenuItem('Select Word', '', @miMenuItemSelected); + AddMenuItem('Select Line', '', @miMenuItemSelected); + FEditSubMenu.AddMenuItem('Selec&t', '', nil).SubMenu := FEditSelectSubMenu; + end; + + FViewSubMenu := TfpgPopupMenu.Create(self); + with FViewSubMenu do + begin + Name := 'FViewSubMenu'; + SetPosition(264, 120, 120, 20); + AddMenuItem('Full Screen', '', @miMenuItemChecked); + AddMenuItem('Tool Bar', '', @miToolBarChecked).Checked := True; + AddMenuItem('Status Bar', '', @miStatusBarChecked).Checked := True; + AddMenuItem('Line Numbers', '', @miMenuItemChecked); + end; FHelpSubMenu := TfpgPopupMenu.Create(self); - FHelpSubMenu.AddMenuItem('&About', 'F12', @miMenuItemSelected); - FHelpSubMenu.AddMenuItem('Test Russian text -> Òåñò', '', @miMenuItemSelected); + with FHelpSubMenu do + begin + Name := 'FHelpSubMenu'; + SetPosition(264, 140, 120, 20); + AddMenuItem('&About', 'F12', @btnAboutClicked); + AddMenuItem('Test Russian text -> Òåñò', '', @miMenuItemSelected); + end; + + {@VFD_BODY_END: MainForm} + {%endregion} - // Create main menu bar - FMenuBar := CreateMenuBar(self); + // Attach sub menus to main menu bar FMenuBar.AddMenuItem('&File', nil).SubMenu := FFileSubMenu; FMenuBar.AddMenuItem('&Edit', nil).SubMenu := FEditSubMenu; + FMenuBar.AddMenuItem('&View', nil).SubMenu := FViewSubMenu; FMenuBar.AddMenuItem('&Windows', nil); FMenuBar.AddMenuItem('&Disabled', nil).Enabled := False; FMenuBar.AddMenuItem('&Help', nil).SubMenu := FHelpSubMenu; - - edit1 := TfpgEdit.Create(self); - edit1.SetPosition(10, 70, 100, 24); end; diff --git a/examples/gui/mousecursor/cursordemo.lpi b/examples/gui/mousecursor/cursordemo.lpi new file mode 100644 index 00000000..7aea18fa --- /dev/null +++ b/examples/gui/mousecursor/cursordemo.lpi @@ -0,0 +1,80 @@ +<?xml version="1.0"?> +<CONFIG> + <ProjectOptions> + <Version Value="7"/> + <General> + <Flags> + <SaveOnlyProjectUnits Value="True"/> + </Flags> + <SessionStorage Value="None"/> + <MainUnit Value="0"/> + <TargetFileExt Value=""/> + <Title Value="cursordemo"/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <VersionInfo> + <ProjectVersion Value=""/> + <Language Value=""/> + <CharSet Value=""/> + </VersionInfo> + <PublishOptions> + <Version Value="2"/> + <IgnoreBinaries Value="False"/> + <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> + <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/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="cursordemo.lpr"/> + <IsPartOfProject Value="True"/> + <UnitName Value="cursordemo"/> + </Unit0> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="8"/> + <SearchPaths> + <UnitOutputDirectory Value="units"/> + </SearchPaths> + <Parsing> + <SyntaxOptions> + <UseAnsiStrings Value="True"/> + </SyntaxOptions> + </Parsing> + <Linking> + <Options> + <Win32> + <GraphicApplication Value="True"/> + </Win32> + </Options> + </Linking> + <Other> + <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/examples/gui/mousecursor/cursordemo.lpr b/examples/gui/mousecursor/cursordemo.lpr new file mode 100644 index 00000000..2cbcf1a3 --- /dev/null +++ b/examples/gui/mousecursor/cursordemo.lpr @@ -0,0 +1,227 @@ +program cursordemo; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes, fpg_base, fpg_main, fpg_form, fpg_panel, fpg_label; + +type + + TMainForm = class(TfpgForm) + public + {@VFD_HEAD_BEGIN: MainForm} + Panel1: TfpgPanel; + Panel2: TfpgPanel; + Panel3: TfpgPanel; + Panel4: TfpgPanel; + Panel5: TfpgPanel; + Panel6: TfpgPanel; + Panel7: TfpgPanel; + Panel8: TfpgPanel; + Panel9: TfpgPanel; + Panel10: TfpgPanel; + Panel11: TfpgPanel; + Panel12: TfpgPanel; + Panel13: TfpgPanel; + Label1: TfpgLabel; + {@VFD_HEAD_END: MainForm} + procedure AfterCreate; override; + end; + +{@VFD_NEWFORM_DECL} + + + +{@VFD_NEWFORM_IMPL} + +procedure TMainForm.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: MainForm} + Name := 'MainForm'; + SetPosition(388, 200, 311, 204); + WindowTitle := 'Mouse Cursor Demo'; + Hint := ''; + WindowPosition := wpOneThirdDown; + + Label1 := TfpgLabel.Create(self); + with Label1 do + begin + Name := 'Label1'; + SetPosition(20, 4, 256, 16); + Alignment := taCenter; + FontDesc := '#Label2'; + Hint := ''; + Text := 'Available mouse cursors in fpGUI'; + end; + + Panel1 := TfpgPanel.Create(self); + with Panel1 do + begin + Name := 'Panel1'; + SetPosition(8, 32, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcDefault'; + MouseCursor := mcDefault; + end; + + Panel2 := TfpgPanel.Create(self); + with Panel2 do + begin + Name := 'Panel2'; + SetPosition(108, 32, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcArrow'; + MouseCursor := mcArrow; + end; + + Panel3 := TfpgPanel.Create(self); + with Panel3 do + begin + Name := 'Panel3'; + SetPosition(208, 32, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcCross'; + MouseCursor := mcCross; + end; + + Panel4 := TfpgPanel.Create(self); + with Panel4 do + begin + Name := 'Panel4'; + SetPosition(8, 64, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcIBeam'; + MouseCursor := mcIBeam; + end; + + Panel5 := TfpgPanel.Create(self); + with Panel5 do + begin + Name := 'Panel5'; + SetPosition(108, 64, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcSizeEW'; + MouseCursor := mcSizeEW; + end; + + Panel6 := TfpgPanel.Create(self); + with Panel6 do + begin + Name := 'Panel6'; + SetPosition(208, 64, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcSizeNS'; + MouseCursor := mcSizeNS; + end; + + Panel7 := TfpgPanel.Create(self); + with Panel7 do + begin + Name := 'Panel7'; + SetPosition(8, 96, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcSizeNWSE'; + MouseCursor := mcSizeNWSE; + end; + + Panel8 := TfpgPanel.Create(self); + with Panel8 do + begin + Name := 'Panel8'; + SetPosition(108, 96, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcSizeNESW'; + MouseCursor := mcSizeNESW; + end; + + Panel9 := TfpgPanel.Create(self); + with Panel9 do + begin + Name := 'Panel9'; + SetPosition(208, 96, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcSizeSWNE'; + MouseCursor := mcSizeSWNE; + end; + + Panel10 := TfpgPanel.Create(self); + with Panel10 do + begin + Name := 'Panel10'; + SetPosition(8, 128, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcSizeSENW'; + MouseCursor := mcSizeSENW; + end; + + Panel11 := TfpgPanel.Create(self); + with Panel11 do + begin + Name := 'Panel11'; + SetPosition(108, 128, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcMove'; + MouseCursor := mcMove; + end; + + Panel12 := TfpgPanel.Create(self); + with Panel12 do + begin + Name := 'Panel12'; + SetPosition(208, 128, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcHourGlass'; + MouseCursor := mcHourGlass; + end; + + Panel13 := TfpgPanel.Create(self); + with Panel13 do + begin + Name := 'Panel13'; + SetPosition(8, 160, 92, 24); + FontDesc := '#Grid'; + Hint := ''; + Text := 'mcHand'; + MouseCursor := mcHand; + end; + + {@VFD_BODY_END: MainForm} + {%endregion} +end; + + +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. + diff --git a/examples/gui/mousecursor/extrafpc.cfg b/examples/gui/mousecursor/extrafpc.cfg new file mode 100644 index 00000000..775d592f --- /dev/null +++ b/examples/gui/mousecursor/extrafpc.cfg @@ -0,0 +1,5 @@ +-FUunits +-Fu../../../lib/$fpctarget +-Xs +-XX +-CX diff --git a/examples/gui/mousecursor/units/.gitignore b/examples/gui/mousecursor/units/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/examples/gui/mousecursor/units/.gitignore @@ -0,0 +1 @@ +* diff --git a/examples/gui/splashscreen/commands.pas b/examples/gui/splashscreen/commands.pas index c487b0b1..e9adf75d 100644 --- a/examples/gui/splashscreen/commands.pas +++ b/examples/gui/splashscreen/commands.pas @@ -37,10 +37,22 @@ type end; + TShowSplashCommand = class(TInterfacedObject, ICommand) + public + procedure Execute; + end; + + + TShowBorderlessForm = class(TInterfacedObject, ICommand) + public + procedure Execute; + end; + + implementation uses - fpg_main, SysUtils; + SysUtils, fpg_main, frm_main, frm_splashscreen; { TNullInterfacedObject } @@ -72,18 +84,30 @@ end; procedure TAddCommand.Execute; begin - Writeln('>> TAddComand.Execute'); FMemo.Lines.Add('Hello ' + IntToStr(Random(500))); - FMemo.Invalidate; end; { TExitCommand } procedure TExitCommand.Execute; begin - Writeln('>> TExitComand.Execute'); fpgApplication.Terminated := True; end; +{ TShowSplashCommand } + +procedure TShowSplashCommand.Execute; +begin + frmSplash := TSplashForm.Create(nil); + frmSplash.Show; +end; + +{ TShowBorderlessForm } + +procedure TShowBorderlessForm.Execute; +begin + TBorderLessForm.Execute; +end; + end. diff --git a/examples/gui/splashscreen/frm_main.pas b/examples/gui/splashscreen/frm_main.pas index 6835b98a..7ecf663c 100644 --- a/examples/gui/splashscreen/frm_main.pas +++ b/examples/gui/splashscreen/frm_main.pas @@ -9,27 +9,39 @@ unit frm_main; interface uses - SysUtils, Classes, fpg_base, fpg_main, fpg_edit, - fpg_widget, fpg_form, fpg_label, fpg_button, - fpg_listbox, fpg_memo, fpg_combobox, fpg_grid, - fpg_dialogs, fpg_checkbox, fpg_tree, fpg_trackbar, - fpg_progressbar, fpg_radiobutton, fpg_tab, fpg_menu, - fpg_panel; + SysUtils, Classes, fpg_base, fpg_main, fpg_form, fpg_button, + fpg_memo, fpg_menu, fpg_label, fpg_trackbar; type TMainForm = class(TfpgForm) private - procedure CommandHandler(Sender: TObject); - public {@VFD_HEAD_BEGIN: MainForm} btnAdd: TfpgButton; memName1: TfpgMemo; btnQuit: TfpgButton; MainMenu: TfpgMenuBar; mnuFile: TfpgPopupMenu; + btnShowBorderless: TfpgButton; + btnShowSplash: TfpgButton; + Label1: TfpgLabel; {@VFD_HEAD_END: MainForm} - procedure AfterCreate; override; + public + procedure AfterCreate; override; + end; + + + TBorderLessForm = class(TfpgForm) + private + {@VFD_HEAD_BEGIN: BorderLessForm} + btnClose: TfpgButton; + Label1: TfpgLabel; + TrackBar1: TfpgTrackBar; + {@VFD_HEAD_END: BorderLessForm} + public + constructor Create(AOwner: TComponent); override; + procedure AfterCreate; override; + class procedure Execute; end; {@VFD_NEWFORM_DECL} @@ -42,45 +54,107 @@ uses {@VFD_NEWFORM_IMPL} -{ A single event handler that handles all Command based events. } -procedure TMainForm.CommandHandler(Sender: TObject); -var - cmd: ICommand; - holder: ICommandHolder; +{ TBorderLessForm } + +constructor TBorderLessForm.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + Include(FWindowAttributes, waBorderLess); // borderless and steals focus like a normal form +end; + +procedure TBorderLessForm.AfterCreate; begin - if Supports(Sender, ICommandHolder, holder) then + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: BorderLessForm} + Name := 'BorderLessForm'; + SetPosition(321, 549, 323, 133); + WindowTitle := 'BorderLessForm'; + Hint := ''; + WindowPosition := wpOneThirdDown; + + btnClose := TfpgButton.Create(self); + with btnClose do + begin + Name := 'btnClose'; + SetPosition(232, 100, 80, 24); + Text := 'Close'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + ModalResult := mrOK; + TabOrder := 1; + end; + + Label1 := TfpgLabel.Create(self); + with Label1 do begin - cmd := holder.GetCommand; - cmd.Execute; + Name := 'Label1'; + SetPosition(8, 32, 304, 16); + FontDesc := '#Label2'; + Hint := ''; + Layout := tlCenter; + Text := 'Look Mom, no borders!'; end; + + TrackBar1 := TfpgTrackBar.Create(self); + with TrackBar1 do + begin + Name := 'TrackBar1'; + SetPosition(72, 60, 148, 30); + Hint := ''; + TabOrder := 3; + end; + + {@VFD_BODY_END: BorderLessForm} + {%endregion} end; +class procedure TBorderLessForm.Execute; +var + frm: TBorderLessForm; +begin + frm := TBorderLessForm.Create(nil); + try + frm.ShowModal; + finally + frm.Free; + end; +end; + + +{ TMainForm } + procedure TMainForm.AfterCreate; begin + {%region 'Auto-generated GUI code' -fold} {@VFD_BODY_BEGIN: MainForm} Name := 'MainForm'; SetPosition(293, 236, 416, 273); WindowTitle := 'Command Interface Test'; + Hint := ''; WindowPosition := wpScreenCenter; btnAdd := TfpgButton.Create(self); with btnAdd do begin Name := 'btnAdd'; - SetPosition(332, 36, 75, 24); - Text := 'Add'; + SetPosition(260, 28, 148, 24); + Text := 'Add Text to Memo'; FontDesc := '#Label1'; + Hint := ''; ImageName := ''; - OnClick := @CommandHandler; + TabOrder := 1; end; memName1 := TfpgMemo.Create(self); with memName1 do begin Name := 'memName1'; - SetPosition(8, 36, 316, 228); + SetPosition(8, 28, 236, 236); + Hint := ''; Lines.Add(''); FontDesc := '#Edit1'; + TabOrder := 2; end; btnQuit := TfpgButton.Create(self); @@ -90,8 +164,9 @@ begin SetPosition(332, 240, 75, 24); Text := 'Quit'; FontDesc := '#Label1'; + Hint := ''; ImageName := ''; - OnClick := @CommandHandler; + TabOrder := 3; end; MainMenu := TfpgMenuBar.Create(self); @@ -107,16 +182,56 @@ begin begin Name := 'mnuFile'; SetPosition(44, 72, 120, 20); - AddMenuItem('Quit', '', @CommandHandler); + AddMenuItem('Quit', '', nil); + end; + + btnShowBorderless := TfpgButton.Create(self); + with btnShowBorderless do + begin + Name := 'btnShowBorderless'; + SetPosition(260, 56, 148, 24); + Text := 'Show Borderless Form'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 6; + end; + + btnShowSplash := TfpgButton.Create(self); + with btnShowSplash do + begin + Name := 'btnShowSplash'; + SetPosition(260, 84, 148, 24); + Text := 'Show Splash Screen'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 7; + end; + + Label1 := TfpgLabel.Create(self); + with Label1 do + begin + Name := 'Label1'; + SetPosition(252, 120, 156, 116); + FontDesc := '#Label1'; + Hint := ''; + Text := 'Note the difference between a borderless form and a splash screen (wtPopup) form. wtPopup doesn''t steal focus (eg: hint window)'; + WrapText := True; end; {@VFD_BODY_END: MainForm} - + {%endregion} + MainMenu.AddMenuItem('File', nil).SubMenu := mnuFile; - // instantiate the Command classes + { Instantiate the Command classes. By setting a Command it + take preference over OnClick event handlers and is handled + automatically for you. No need to declare a OnClick event handler. } btnAdd.SetCommand(TAddCommand.Create(memName1)); btnQuit.SetCommand(TExitCommand.Create); + btnShowBorderless.SetCommand(TShowBorderlessForm.Create); + btnShowSplash.SetCommand(TShowSplashCommand.Create); // The menu item File|Quit shares the command of btnQuit mnuFile.MenuItemByName('Quit').SetCommand(btnQuit.GetCommand); end; diff --git a/examples/gui/splashscreen/frm_splashscreen.pas b/examples/gui/splashscreen/frm_splashscreen.pas index 46433ab0..30dff1c9 100644 --- a/examples/gui/splashscreen/frm_splashscreen.pas +++ b/examples/gui/splashscreen/frm_splashscreen.pas @@ -5,33 +5,24 @@ unit frm_splashscreen; interface uses - SysUtils, Classes, fpg_base, fpg_main, fpg_edit, - fpg_widget, fpg_form, fpg_label, fpg_button, - fpg_listbox, fpg_memo, fpg_combobox, fpg_grid, - fpg_dialogs, fpg_checkbox, fpg_tree, fpg_trackbar, - fpg_progressbar, fpg_radiobutton, fpg_tab, fpg_menu, - fpg_panel, fpg_popupcalendar, fpg_gauge; + SysUtils, Classes, fpg_base, fpg_main, fpg_form, fpg_panel, + fpg_label; type - - { TSplashForm } - TSplashForm = class(TfpgForm) - procedure SplashFormShow(Sender: TObject); - procedure TimerFired(Sender: TObject); private - tmr: TfpgTimer; - protected - procedure HandleLMouseUp(x, y: integer; shiftstate: TShiftState); override; - procedure AdjustWindowStyle; override; - public {@VFD_HEAD_BEGIN: SplashForm} pnlName1: TfpgBevel; lblName2: TfpgLabel; lblName1: TfpgLabel; {@VFD_HEAD_END: SplashForm} + tmr: TfpgTimer; + procedure SplashFormShow(Sender: TObject); + procedure TimerFired(Sender: TObject); + procedure SplashFormClick(Sender: TObject); + public constructor Create(AOwner: TComponent); override; - procedure AfterCreate; override; + procedure AfterCreate; override; end; {@VFD_NEWFORM_DECL} @@ -43,6 +34,11 @@ implementation {@VFD_NEWFORM_IMPL} +procedure TSplashForm.SplashFormClick(Sender: TObject); +begin + TimerFired(nil); +end; + procedure TSplashForm.SplashFormShow(Sender: TObject); begin tmr.Enabled := True; @@ -56,28 +52,17 @@ begin Hide; end; -procedure TSplashForm.HandleLMouseUp(x, y: integer; shiftstate: TShiftState); -begin - inherited HandleLMouseUp(x, y, shiftstate); - TimerFired(nil); -end; - -procedure TSplashForm.AdjustWindowStyle; -begin - inherited AdjustWindowStyle; - -end; - constructor TSplashForm.Create(AOwner: TComponent); begin inherited Create(AOwner); - WindowType := wtPopup; // removes borders and title bar + WindowType := wtPopup; // borderless but doesn't steal focus WindowAttributes := WindowAttributes + [waStayOnTop]; // well, it lets the window stay on top. :) tmr := TfpgTimer.Create(3000); tmr.OnTimer := @TimerFired; OnShow := @SplashFormShow; + OnClick := @SplashFormClick; end; procedure TSplashForm.AfterCreate; diff --git a/examples/gui/splashscreen/test.lpi b/examples/gui/splashscreen/test.lpi index d347a75a..fa0ecd6b 100644 --- a/examples/gui/splashscreen/test.lpi +++ b/examples/gui/splashscreen/test.lpi @@ -1,19 +1,18 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> - <ProjectVersion Value=""/> + <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> </VersionInfo> <PublishOptions> <Version Value="2"/> diff --git a/examples/gui/stdimages/stdimglist.lpi b/examples/gui/stdimages/stdimglist.lpi index d136ae4d..94af915b 100644 --- a/examples/gui/stdimages/stdimglist.lpi +++ b/examples/gui/stdimages/stdimglist.lpi @@ -1,19 +1,18 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> - <ProjectVersion Value=""/> + <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> </VersionInfo> <PublishOptions> <Version Value="2"/> diff --git a/examples/gui/stdimages/stdimglist.lpr b/examples/gui/stdimages/stdimglist.lpr index c70f6a0d..09e57990 100644 --- a/examples/gui/stdimages/stdimglist.lpr +++ b/examples/gui/stdimages/stdimglist.lpr @@ -15,7 +15,6 @@ type protected procedure HandlePaint; override; public - constructor Create(aowner: TComponent); override; procedure AfterCreate; override; end; @@ -25,6 +24,13 @@ procedure TMainForm.AfterCreate; begin SetPosition(100,100,700,500); WindowTitle := 'fpGUI Standard Image Listing'; + WindowPosition := wpOneThirdDown; + MinWidth := 200; + MinHeight := 100; + + btnClose := CreateButton(self, Width-90, Height-35, 75, 'Quit', @btnCloseClick); + btnClose.ImageName := 'stdimg.quit'; + btnClose.Anchors := [anRight, anBottom]; end; procedure TMainForm.btnCloseClick(Sender: TObject); @@ -68,16 +74,6 @@ begin sl.Free; end; -constructor TMainForm.Create(aowner: TComponent); -begin - inherited Create(aowner); - // Place button in bottom right corner. - btnClose := CreateButton(self, Width-90, Height-35, 75, 'Quit', @btnCloseClick); - btnClose.ImageName := 'stdimg.quit'; -// btnClose.Focusable := False; - btnClose.Anchors := [anRight, anBottom]; -end; - procedure MainProc; var frm : TMainForm; diff --git a/examples/gui/tabtest/tabtest.lpi b/examples/gui/tabtest/tabtest.lpi index ac64bf44..b29eb7a0 100644 --- a/examples/gui/tabtest/tabtest.lpi +++ b/examples/gui/tabtest/tabtest.lpi @@ -1,15 +1,14 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> @@ -41,8 +40,15 @@ </ProjectOptions> <CompilerOptions> <Version Value="8"/> + <SearchPaths> + <UnitOutputDirectory Value="units"/> + </SearchPaths> + <Linking> + <Debugging> + <UseHeaptrc Value="True"/> + </Debugging> + </Linking> <Other> - <CustomOptions Value="-FUunits"/> <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> diff --git a/examples/gui/tabtest/tabtest.lpr b/examples/gui/tabtest/tabtest.lpr index 46d1a108..016d5af5 100644 --- a/examples/gui/tabtest/tabtest.lpr +++ b/examples/gui/tabtest/tabtest.lpr @@ -64,8 +64,14 @@ procedure TMainForm.cbTabPosChanged(Sender: TObject); begin if cbTabPos.FocusItem = 0 then pcMain.TabPosition := tpTop + else if cbTabPos.FocusItem = 1 then + pcMain.TabPosition := tpBottom + else if cbTabPos.FocusItem = 2 then + pcMain.TabPosition := tpLeft + else if cbTabPos.FocusItem = 3 then + pcMain.TabPosition := tpRight else - pcMain.TabPosition := tpBottom; + pcMain.TabPosition := tpNone; end; constructor TMainForm.Create(AOwner: TComponent); @@ -85,6 +91,7 @@ begin pcMain.Width := Width - 20; pcMain.Height := 300; pcMain.Anchors := [anLeft, anTop, anRight, anBottom]; +// pcMain.FixedTabWidth:=150; // Tab One tsOne := TfpgTabSheet.Create(pcMain); @@ -124,6 +131,9 @@ begin cbTabPos := CreateComboBox(self, 300, 320, 80, nil); cbTabPos.Items.Add('tpTop'); cbTabPos.Items.Add('tpBottom'); + cbTabPos.Items.Add('tpLeft'); + cbTabPos.Items.Add('tpRight'); + cbTabPos.Items.Add('tpNone'); cbTabPos.FocusItem := 0; cbTabPos.Anchors := [anBottom, anLeft]; cbTabPos.OnChange := @cbTabPosChanged; diff --git a/examples/readme.txt b/examples/readme.txt index 80aaeee6..05331e24 100644 --- a/examples/readme.txt +++ b/examples/readme.txt @@ -1,22 +1,25 @@ + Compiling the fpGUI Demos + + Compiling any of the examples from the Command Line =================================================== -You need to compile the fpGUI toolkit first as mentioned in -the ../src/readme.txt file. +You need to compile the fpGUI toolkit first as mentioned in the +README.txt file located in the <fpgui>/docs/ directory. I'll assume the fpc executable path has been setup so you can execute 'fpc' -from any directory. Every project in the 'examples' directory has it's -own extrafpc.cfg file. You only need to specify that config file and the -project's main unit to compile it. +from any directory. Every project in the 'examples' directory has its +own extrafpc.cfg file. You only need to specify that config file and the +project's main unit to compile it. The format is as follows: fpc @extrafpc.cfg <project main unit> Example: - fpc @extrafpc.cfg docedit.lpr - or - fpc @extrafpc.cfg helloworld.pas + fpc @extrafpc.cfg docedit.lpr + or + fpc @extrafpc.cfg helloworld.pas ======================================================= |