diff options
Diffstat (limited to 'examples')
21 files changed, 516 insertions, 16 deletions
diff --git a/examples/apps/ide/TODO b/examples/apps/ide/TODO index 9a90c33e..72b9f0db 100644 --- a/examples/apps/ide/TODO +++ b/examples/apps/ide/TODO @@ -1,6 +1,6 @@ Personal todo list for fpGUI IDE project - + Legend ====== @@ -22,8 +22,8 @@ fpGUI IDE [ ] Assembly window [ ] CPU window [x] Syntax highlighting with descent speed. -[ ] Basic Search dialog -[x] Find in Files dialog +[x] Basic Search dialog +[ ] Find in Files dialog [ ] Regex support in all search dialogs [ ] External Tools setup and usage [ ] Keyboard Shortcuts dialog @@ -36,7 +36,7 @@ fpGUI IDE [ ] Unit Testing framework integration (with DUnit2 project) [ ] Code Templates support [o] File Browser tabsheet implementation. File navigation and opening of files. -[ ] GoTo Line Number dialog +[x] GoTo Line Number dialog [ ] Converting all UI to MiG Layout Manager based dialogs. [ ] TextEdit: enable line drawing functionality. eg: some key combination with the cursor (arrow) keys allows line drawing. Double and single line diff --git a/examples/apps/ide/src/extrafpc.cfg b/examples/apps/ide/src/extrafpc.cfg index 2132065d..3622b5cf 100644 --- a/examples/apps/ide/src/extrafpc.cfg +++ b/examples/apps/ide/src/extrafpc.cfg @@ -1,4 +1,4 @@ --FUunits +-FUunits/$fpctarget -Fu../../../../lib/$fpctarget -Fi. -Xs diff --git a/examples/apps/ide/src/units/i386-freebsd/.gitignore b/examples/apps/ide/src/units/i386-freebsd/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/examples/apps/ide/src/units/i386-freebsd/.gitignore @@ -0,0 +1 @@ +* diff --git a/examples/apps/ide/src/units/i386-linux/.gitignore b/examples/apps/ide/src/units/i386-linux/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/examples/apps/ide/src/units/i386-linux/.gitignore @@ -0,0 +1 @@ +* diff --git a/examples/apps/ide/src/units/i386-win32/.gitignore b/examples/apps/ide/src/units/i386-win32/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/examples/apps/ide/src/units/i386-win32/.gitignore @@ -0,0 +1 @@ +* diff --git a/examples/apps/ide/src/units/x86_64-freebsd/.gitignore b/examples/apps/ide/src/units/x86_64-freebsd/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/examples/apps/ide/src/units/x86_64-freebsd/.gitignore @@ -0,0 +1 @@ +* diff --git a/examples/apps/ide/src/units/x86_64-linux/.gitignore b/examples/apps/ide/src/units/x86_64-linux/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/examples/apps/ide/src/units/x86_64-linux/.gitignore @@ -0,0 +1 @@ +* diff --git a/examples/gui/customwindow/close.bmp b/examples/gui/customwindow/close.bmp Binary files differnew file mode 100644 index 00000000..af6745a5 --- /dev/null +++ b/examples/gui/customwindow/close.bmp diff --git a/examples/gui/customwindow/custom_window.lpi b/examples/gui/customwindow/custom_window.lpi new file mode 100644 index 00000000..2059fa29 --- /dev/null +++ b/examples/gui/customwindow/custom_window.lpi @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectOptions> + <Version Value="9"/> + <General> + <SessionStorage Value="InProjectDir"/> + <MainUnit Value="0"/> + <Title Value="custom_window"/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <i18n> + <EnableI18N LFM="False"/> + </i18n> + <VersionInfo> + <StringTable ProductVersion=""/> + </VersionInfo> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + </local> + </RunParams> + <RequiredPackages Count="1"> + <Item1> + <PackageName Value="fpgui_toolkit"/> + </Item1> + </RequiredPackages> + <Units Count="2"> + <Unit0> + <Filename Value="custom_window.lpr"/> + <IsPartOfProject Value="True"/> + <UnitName Value="custom_window"/> + </Unit0> + <Unit1> + <Filename Value="images.inc"/> + <IsPartOfProject Value="True"/> + </Unit1> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + </SearchPaths> + </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/customwindow/custom_window.lpr b/examples/gui/customwindow/custom_window.lpr new file mode 100644 index 00000000..eab06e5d --- /dev/null +++ b/examples/gui/customwindow/custom_window.lpr @@ -0,0 +1,352 @@ +{ This was a very quick and dirty demo to show how custom windows with your + own style of borders (eg: like Chrome or elementryOS) can be implement. + There is obviously lots of scope for improving this code and creating + custom widgets to make better use of code reuse and abstraction. } +program custom_window; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes, SysUtils, + fpg_base, fpg_main, fpg_form, fpg_button, + fpg_stylemanager, fpg_cmdlineparams, fpg_grid, + fpg_StringGridBuilder, fpg_editbtn, fpg_checkbox, + fpg_panel, fpg_dialogs; + +type + + TMainForm = class(TfpgForm) + procedure ResizeClicked(Sender: TObject); + private + {@VFD_HEAD_BEGIN: MainForm} + btnQuit: TfpgButton; + Grid1: TfpgStringGrid; + FilenameEdit1: TfpgFileNameEdit; + btnGo: TfpgButton; + CheckBox1: TfpgCheckBox; + bvlTitle: TfpgBevel; + btnClose: TfpgImagePanel; + btnResize: TfpgImagePanel; + bvlTasks: TfpgBevel; + {@VFD_HEAD_END: MainForm} + FLastPos: TPoint; + FMouseTracked: Boolean; + procedure TitleMouseDown(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); + procedure TitleMouseUp(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); + procedure TitleMouseMoved(Sender: TObject; AShift: TShiftState; const AMousePos: TPoint); + procedure btnCloseClicked(Sender: TObject); + procedure PaintTasksPanel(Sender: TObject); + procedure PaintTitle(Sender: TObject); + procedure FormPaint(Sender: TObject); + procedure btnQuitClicked(Sender: TObject); + procedure btnGoClicked(Sender: TObject); + public + constructor Create(AOwner: TComponent); override; + procedure AfterCreate; override; + end; + +{@VFD_NEWFORM_DECL} + +const + cBackground = TfpgColor($FFf5f5f5); + cGradientTop = TfpgColor($FFe5e5e5); + cGradientBottom = TfpgColor($FFbcbcbc); + cBorder = TfpgColor($FF7c7c7c); + cGrayPanel = TfpgColor($FFdedede); + + { tip: probably best to use specific fonts for specific OSes } + cHeader1 = 'Arial-11:bold:antialias=true'; + cHeader2 = 'Arial-10:antialias=true'; + +{$I images.inc} + +{@VFD_NEWFORM_IMPL} + +procedure TMainForm.ResizeClicked(Sender: TObject); +begin + ShowMessage('I''ll leave this one up to you to implement and experiment with. ;-)', 'Hint'); +end; + +procedure TMainForm.TitleMouseDown(Sender: TObject; AButton: TMouseButton; + AShift: TShiftState; const AMousePos: TPoint); +begin + FMouseTracked := True; + FLastPos := bvlTitle.WindowToScreen(self, AMousePos); + bvlTitle.CaptureMouse; +end; + +procedure TMainForm.TitleMouseUp(Sender: TObject; AButton: TMouseButton; + AShift: TShiftState; const AMousePos: TPoint); +begin + FMouseTracked := False; + bvlTitle.ReleaseMouse; +end; + +procedure TMainForm.TitleMouseMoved(Sender: TObject; AShift: TShiftState; + const AMousePos: TPoint); +var + dx, dy: integer; + pt: TPoint; +begin + pt := WindowToScreen(self, AMousePos); + if not FMouseTracked then + begin + FLastPos := pt; + Exit; + end; + + dx := pt.X - FLastPos.X; + dy := pt.Y - FLastPos.Y; + Left := Left + dx; + Top := Top + dy; + FLastPos := pt; + UpdateWindowPosition; +end; + +procedure TMainForm.btnCloseClicked(Sender: TObject); +begin + btnQuit.Click; +end; + +procedure TMainForm.PaintTasksPanel(Sender: TObject); +begin + with bvlTasks do + begin + Canvas.Clear(cGrayPanel); + + Canvas.Color := cBorder; + Canvas.DrawRectangle(0, 0, Width, Height); + + Canvas.TextColor := cBorder; + // Output some sample text + Canvas.Font := fpgGetFont(cHeader1); + Canvas.DrawText(8, 10, 'Personal'); + Canvas.Font := fpgGetFont(cHeader2); + Canvas.DrawText(20, 30, 'Home'); + Canvas.DrawText(20, 50, 'Documents'); + Canvas.DrawText(20, 70, 'Music'); + Canvas.DrawText(20, 90, 'Pictures'); + Canvas.Font := fpgGetFont(cHeader1); + Canvas.DrawText(8, 110, 'Network'); + Canvas.Font := fpgGetFont(cHeader2); + Canvas.DrawText(20, 130, 'Entire network'); + end; +end; + +procedure TMainForm.PaintTitle(Sender: TObject); +var + r: TfpgRect; +begin + r.SetRect(0, 1, Width, 46); + with bvlTitle do + begin + Canvas.GradientFill(r, cGradientTop, cGradientBottom, gdVertical); + + Canvas.Color := TfpgColor($FFc9c9c9); + Canvas.DrawLine(0, Height-2, Width, Height-2); + + Canvas.Color := cBorder; + Canvas.DrawRectangle(0, 0, Width, Height); + + Canvas.TextColor := cBorder; + Canvas.Font := fpgGetFont(cHeader1); + Canvas.DrawText(30, 8, Width-60, 20, WindowTitle, [txtHCenter, txtTop]); + end; +end; + +procedure TMainForm.FormPaint(Sender: TObject); +begin + Canvas.Color := cBorder; + Canvas.DrawRectangle(0, 0, Width, Height); +end; + +procedure TMainForm.btnQuitClicked(Sender: TObject); +begin + Close; +end; + +procedure TMainForm.btnGoClicked(Sender: TObject); +var + sgb: TStringGridBuilder; +begin + try + sgb := TStringGridBuilder.CreateCustom(Grid1, FilenameEdit1.FileName, CheckBox1.Checked); + sgb.Run; + finally + sgb.Free; + end; +end; + +constructor TMainForm.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + Include(FWindowAttributes, waBorderLess); // borderless and steals focus like a normal form + FMouseTracked := False; + + fpgSetNamedColor(clWindowBackground, cBackground); + + fpgImages.AddBMP( // 8x9 pixels. + 'my.close', + @img_close, + sizeof(img_close)); + + fpgImages.AddBMP( // 10x11 pixels. + 'my.resize', + @img_resize, + sizeof(img_resize)); +end; + +procedure TMainForm.AfterCreate; +begin + {%region 'Auto-generated GUI code' -fold} + {@VFD_BODY_BEGIN: MainForm} + Name := 'MainForm'; + SetPosition(464, 271, 866, 473); + WindowTitle := 'fpGUI Custom Window Demo'; + Hint := ''; + OnPaint := @FormPaint; + + btnQuit := TfpgButton.Create(self); + with btnQuit do + begin + Name := 'btnQuit'; + SetPosition(772, 436, 80, 23); + Text := 'Quit'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 1; + OnClick := @btnQuitClicked; + end; + + Grid1 := TfpgStringGrid.Create(self); + with Grid1 do + begin + Name := 'Grid1'; + SetPosition(182, 120, 666, 276); + BackgroundColor := TfpgColor($80000002); + FontDesc := '#Grid'; + HeaderFontDesc := '#GridHeader'; + Hint := ''; + RowCount := 0; + RowSelect := False; + TabOrder := 2; + end; + + FilenameEdit1 := TfpgFileNameEdit.Create(self); + with FilenameEdit1 do + begin + Name := 'FilenameEdit1'; + SetPosition(182, 92, 510, 24); + ExtraHint := ''; + FileName := ''; + Filter := 'CSV Files (*.csv)|*.csv'; + InitialDir := ''; + TabOrder := 3; + end; + + btnGo := TfpgButton.Create(self); + with btnGo do + begin + Name := 'btnGo'; + SetPosition(768, 92, 80, 23); + Text := 'GO'; + FontDesc := '#Label1'; + Hint := ''; + ImageName := ''; + TabOrder := 4; + OnClick := @btnGoClicked; + end; + + CheckBox1 := TfpgCheckBox.Create(self); + with CheckBox1 do + begin + Name := 'CheckBox1'; + SetPosition(184, 68, 120, 19); + FontDesc := '#Label1'; + Hint := ''; + TabOrder := 5; + Text := 'Has Header'; + end; + + bvlTitle := TfpgBevel.Create(self); + with bvlTitle do + begin + Name := 'bvlTitle'; + SetPosition(0, 0, 866, 48); + Anchors := [anLeft,anRight,anTop]; + Hint := ''; + Shape := bsSpacer; + OnPaint := @PaintTitle; + OnMouseMove := @TitleMouseMoved; + OnMouseDown := @TitleMouseDown; + OnMouseUp := @TitleMouseUp; + end; + + btnClose := TfpgImagePanel.Create(bvlTitle); + with btnClose do + begin + Name := 'btnClose'; + SetPosition(9, 8, 8, 9); + OwnsImage := False; + OnClick := @btnCloseClicked; + end; + + btnResize := TfpgImagePanel.Create(bvlTitle); + with btnResize do + begin + Name := 'btnResize'; + SetPosition(849, 8, 10, 11); + OwnsImage := False; + OnClick := @ResizeClicked; + end; + + bvlTasks := TfpgBevel.Create(self); + with bvlTasks do + begin + Name := 'bvlTasks'; + SetPosition(0, 47, 170, 426); + Anchors := [anLeft,anTop,anBottom]; + Hint := ''; + Shape := bsSpacer; + OnPaint := @PaintTasksPanel; + end; + + {@VFD_BODY_END: MainForm} + {%endregion} + + btnClose.Image := fpgImages.GetImage('my.close'); + btnResize.Image := fpgImages.GetImage('my.resize'); +end; + + +procedure MainProc; +var + frm: TMainForm; +begin + fpgApplication.Initialize; + + { Set our new style as the default (before we create any forms), unless + a the end-user specified a different style via the command line. } + if not gCommandLineParams.IsParam('style') then + begin + if fpgStyleManager.SetStyle('Plastic Light Gray') then + fpgStyle := fpgStyleManager.Style; + end; + + frm := TMainForm.Create(nil); + try + frm.Show; + fpgApplication.Run; + finally + frm.Free; + end; +end; + +begin + MainProc; +end. + diff --git a/examples/gui/customwindow/extrafpc.cfg b/examples/gui/customwindow/extrafpc.cfg new file mode 100644 index 00000000..89eafa99 --- /dev/null +++ b/examples/gui/customwindow/extrafpc.cfg @@ -0,0 +1,10 @@ +-FUunits +-Fu../../../lib/$fpctarget +-Fu../common/ +-Xs +-XX +-CX +#ifdef mswindows +-WG +#endif + diff --git a/examples/gui/customwindow/images.inc b/examples/gui/customwindow/images.inc new file mode 100644 index 00000000..79663a24 --- /dev/null +++ b/examples/gui/customwindow/images.inc @@ -0,0 +1,57 @@ + +const + img_close: array[0..337] of byte = ( + 66, 77, 82, 1, 0, 0, 0, 0, 0, 0,122, 0, 0, 0,108, 0, 0, + 0, 8, 0, 0, 0, 9, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 216, 0, 0, 0,196, 14, 0, 0,196, 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 66, 71, 82,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,226,226,226,238,238,238,225,225,225,223,223,223,223,223, + 223,226,226,226,238,238,238,226,226,226,228,228,228,184,184,184,231, + 231,231,226,226,226,226,226,226,230,230,230,184,184,184,228,228,228, + 172,172,172,160,160,160,173,173,173,231,231,231,231,231,231,173,173, + 173,160,160,160,172,172,172,216,216,216,159,159,159,153,153,153,170, + 170,170,168,168,168,153,153,153,157,157,157,215,215,215,225,225,225, + 219,219,219,165,165,165,149,149,149,149,149,149,162,162,162,218,218, + 218,225,225,225,227,227,227,229,229,229,158,158,158,141,141,141,142, + 142,142,163,163,163,232,232,232,227,227,227,227,227,227,152,152,152, + 136,136,136,146,146,146,144,144,144,136,136,136,154,154,154,228,228, + 228,149,149,149,128,128,128,140,140,140,217,217,217,215,215,215,138, + 138,138,128,128,128,150,150,150,213,213,213,147,147,147,214,214,214, + 226,226,226,226,226,226,214,214,214,146,146,146,213,213,213); + + +const + img_resize: array[0..473] of byte = ( + 66, 77,218, 1, 0, 0, 0, 0, 0, 0,122, 0, 0, 0,108, 0, 0, + 0, 10, 0, 0, 0, 11, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 96, 1, 0, 0,196, 14, 0, 0,196, 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 66, 71, 82,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,242,242,242,242,242,242,242,242,242,242,242,242,233,233, + 233,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223, 0, + 0,167,167,167,167,167,167,167,167,167,162,162,162,189,189,189,223, + 223,223,223,223,223,223,223,223,223,223,223,223,223,223, 0, 0,157, + 157,157,157,157,157,157,157,157,193,193,193,226,226,226,224,224,224, + 224,224,224,224,224,224,224,224,224,224,224,224, 0, 0,146,146,146, + 141,141,141,144,144,144,164,164,164,229,229,229,224,224,224,224,224, + 224,224,224,224,224,224,224,224,224,224, 0, 0,131,131,131,175,175, + 175,146,146,146,133,133,133,153,153,153,224,224,224,224,224,224,224, + 224,224,224,224,224,224,224,224, 0, 0,174,174,174,225,225,225,215, + 215,215,146,146,146,208,208,208,228,228,228,239,239,239,227,227,227, + 225,225,225,235,235,235, 0, 0,225,225,225,225,225,225,225,225,225, + 225,225,225,225,225,225,225,225,225,183,183,183,232,232,232,235,235, + 235,201,201,201, 0, 0,226,226,226,226,226,226,226,226,226,226,226, + 226,226,226,226,167,167,167,153,153,153,167,167,167,193,193,193,154, + 154,154, 0, 0,226,226,226,226,226,226,226,226,226,226,226,226,226, + 226,226,215,215,215,152,152,152,144,144,144,144,144,144,144,144,144, + 0, 0,226,226,226,226,226,226,226,226,226,226,226,226,226,226,226, + 235,235,235,184,184,184,134,134,134,134,134,134,134,134,134, 0, 0, + 227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,168,168, + 168,115,115,115,115,115,115,115,115,115,115,115,115, 0, 0); + + diff --git a/examples/gui/customwindow/resize.bmp b/examples/gui/customwindow/resize.bmp Binary files differnew file mode 100644 index 00000000..8bb264cf --- /dev/null +++ b/examples/gui/customwindow/resize.bmp diff --git a/examples/gui/customwindow/units/.gitignore b/examples/gui/customwindow/units/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/examples/gui/customwindow/units/.gitignore @@ -0,0 +1 @@ +* diff --git a/examples/gui/filedialog/filedialog.lpi b/examples/gui/filedialog/filedialog.lpi index 872cf6e3..f6efbd83 100644 --- a/examples/gui/filedialog/filedialog.lpi +++ b/examples/gui/filedialog/filedialog.lpi @@ -36,7 +36,6 @@ <Unit0> <Filename Value="filedialog.lpr"/> <IsPartOfProject Value="True"/> - <UnitName Value="filedialog"/> </Unit0> </Units> </ProjectOptions> @@ -54,6 +53,7 @@ </SyntaxOptions> </Parsing> <Other> + <CustomOptions Value="-FUunits"/> <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> diff --git a/examples/gui/filedialog/filedialog.lpr b/examples/gui/filedialog/filedialog.lpr index 315b7885..1294ac06 100644 --- a/examples/gui/filedialog/filedialog.lpr +++ b/examples/gui/filedialog/filedialog.lpr @@ -119,7 +119,7 @@ procedure TMainForm.btnOpenFileClick(Sender: TObject); var dlg: TfpgFileDialog; begin - dlg := TfpgFileDialog.Create(nil); + dlg := TfpgFileDialog.Create(Self); try // defines 3 filters (All Files, Object Pascal and Lazarus Project) dlg.Filter := 'All Files (*)|*|Object Pascal (*.pas;*.lpr;*.pp)|*.pas;*.lpr;*.pp|Lazarus Project (*.lpi)|*.lpi'; diff --git a/examples/gui/gridtest/gridtest.lpr b/examples/gui/gridtest/gridtest.lpr index 173806e9..4b53f260 100644 --- a/examples/gui/gridtest/gridtest.lpr +++ b/examples/gui/gridtest/gridtest.lpr @@ -17,7 +17,8 @@ uses fpg_checkbox, fpg_tab, fpg_edit, - fpg_dialogs; + fpg_dialogs, + fpg_scrollbar; type @@ -256,6 +257,14 @@ begin OnDrawCell := @StringGridDrawCell; OnDoubleClick := @StringGridDoubleClicked; OnHeaderClick := @StringGridHeaderClicked; + // Testing various scrollbar styles +// ScrollBarStyle:= ssNone; +// ScrollBarStyle:= ssHorizontal; +// ScrollBarStyle:= ssVertical; + ScrollBarStyle:= ssAutoBoth; +// ScrollBarStyle:= ssHorizVisible; +// ScrollBarStyle:= ssVertiVisible; +// ScrollBarStyle:= ssBothVisible; end; chkShowHeader := TfpgCheckBox.Create(self); diff --git a/examples/gui/modalforms/modalforms.lpi b/examples/gui/modalforms/modalforms.lpi index cc8137c8..2f25e23a 100644 --- a/examples/gui/modalforms/modalforms.lpi +++ b/examples/gui/modalforms/modalforms.lpi @@ -36,7 +36,6 @@ <Unit0> <Filename Value="modalforms.lpr"/> <IsPartOfProject Value="True"/> - <UnitName Value="modalforms"/> </Unit0> </Units> </ProjectOptions> @@ -54,6 +53,7 @@ </SyntaxOptions> </Parsing> <Other> + <CustomOptions Value="-FUunits"/> <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> diff --git a/examples/gui/modalforms/modalforms.lpr b/examples/gui/modalforms/modalforms.lpr index 99f53ab3..bac0af81 100644 --- a/examples/gui/modalforms/modalforms.lpr +++ b/examples/gui/modalforms/modalforms.lpr @@ -99,7 +99,7 @@ procedure TForm1.btnOpenForm2Click(Sender: TObject); var frm: TForm2; begin - frm := TForm2.Create(nil); + frm := TForm2.Create(Self); try frm.ShowModal; writeln('Form2: This should only appear after the form closes.'); @@ -113,6 +113,7 @@ end; constructor TForm1.Create(AOwner: TComponent); begin inherited Create(AOwner); + Visible:=False; WindowTitle := 'Form1'; Sizeable := False; SetPosition(150, 150, 200, 200); @@ -144,7 +145,7 @@ procedure TMainForm.btnOpenForm1Click(Sender: TObject); var frm: TForm1; begin - frm := TForm1.Create(nil); + frm := TForm1.Create(Self); try frm.ShowModal; writeln('Form1: This should only appear after the form closes.'); diff --git a/examples/gui/video_vlc/frmvlcplayer.pas b/examples/gui/video_vlc/frmvlcplayer.pas index 7b44c1e1..aeea3e0c 100644 --- a/examples/gui/video_vlc/frmvlcplayer.pas +++ b/examples/gui/video_vlc/frmvlcplayer.pas @@ -6,7 +6,7 @@ interface uses SysUtils, Classes, fpg_base, fpg_panel, fpg_button, fpg_main, fpg_form, - fpg_editbtn, fpg_memo, fpg_label, libvlc, vlc, fpg_vlc; + fpg_editbtn, fpg_memo, fpg_label, vlc, fpg_vlc; type @@ -23,8 +23,8 @@ type Button3: TfpgButton; Button4: TfpgButton; Memo1: TfpgMemo; - procedure Sync; {@VFD_HEAD_END: VLCPlayerDemo} + procedure Sync; public P : TFpgVLCPlayer; FMsg: String; diff --git a/examples/gui/video_vlc/testfpguivlc.lpi b/examples/gui/video_vlc/testfpguivlc.lpi index d7a4ad2a..7839f71a 100644 --- a/examples/gui/video_vlc/testfpguivlc.lpi +++ b/examples/gui/video_vlc/testfpguivlc.lpi @@ -50,17 +50,17 @@ <UnitName Value="frmvlcplayer"/> </Unit1> <Unit2> - <Filename Value="../fpg_vlc.pas"/> + <Filename Value="../../../src/3rdparty/libvlc/fpg_vlc.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="fpg_vlc"/> </Unit2> <Unit3> - <Filename Value="../../libvlc/libvlc.pp"/> + <Filename Value="../../../src/3rdparty/libvlc/libvlc.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="libvlc"/> </Unit3> <Unit4> - <Filename Value="../../libvlc/vlc.pas"/> + <Filename Value="../../../src/3rdparty/libvlc/vlc.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="vlc"/> </Unit4> |