summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2014-06-23 21:50:48 +0100
committerGraeme Geldenhuys <graemeg@gmail.com>2014-06-23 21:50:48 +0100
commit3b299881fb6656c12780849486682e5875348494 (patch)
treefc215ce5d4eee330b7cee478b92c99d68187f1a3
parent3fee751e6fcdd119a0e0129bc0d9745199a75191 (diff)
downloadfpGUI-3b299881fb6656c12780849486682e5875348494.tar.xz
Demos: fixed compiler warnings.
* fixed deprecated functions * fixed unused variables * fixed unused units * fixed not initialised variables * fixed nested comments
-rw-r--r--examples/gui/colorwheel/frm_main.pas8
-rw-r--r--examples/gui/combobox/frm_main.pas18
-rw-r--r--examples/gui/customstyles/mystyle.pas4
-rw-r--r--examples/gui/drag_n_drop/dndexample.lpr3
-rw-r--r--examples/gui/embedded_form/frm_main.pas1
-rw-r--r--examples/gui/filedialog/filedialog.lpr1
-rw-r--r--examples/gui/listbox/frm_main.pas16
-rw-r--r--examples/gui/splashscreen/frm_main.pas1
8 files changed, 29 insertions, 23 deletions
diff --git a/examples/gui/colorwheel/frm_main.pas b/examples/gui/colorwheel/frm_main.pas
index 63518360..3633b740 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: TFPColor;
+ rgb: TRGBTriple;
c: TfpgColor;
begin
FViaRGB := True; // revent recursive updates
rgb.Red := StrToInt(edR.Text);
rgb.Green := StrToInt(edG.Text);
rgb.Blue := StrToInt(edB.Text);
- c := FPColorTofpgColor(rgb);
+ c := RGBTripleTofpgColor(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: TFPColor;
+ rgb: TRGBTriple;
c: TfpgColor;
begin
c := ValueBar1.SelectedColor;
- rgb := fpgColorToFPColor(c);
+ rgb := fpgColorToRGBTriple(c);
edR.Text := IntToStr(rgb.Red);
edG.Text := IntToStr(rgb.Green);
edB.Text := IntToStr(rgb.Blue);
diff --git a/examples/gui/combobox/frm_main.pas b/examples/gui/combobox/frm_main.pas
index e1a293df..6471963d 100644
--- a/examples/gui/combobox/frm_main.pas
+++ b/examples/gui/combobox/frm_main.pas
@@ -5,12 +5,18 @@ 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_basegrid, fpg_grid,
- fpg_dialogs, fpg_checkbox, fpg_tree, fpg_trackbar,
- fpg_progressbar, fpg_radiobutton, fpg_tab, fpg_menu,
- fpg_panel, fpg_popupcalendar, fpg_gauge, fpg_editcombo;
+ SysUtils,
+ Classes,
+ fpg_base,
+ fpg_main,
+ fpg_form,
+ fpg_label,
+ fpg_button,
+ fpg_combobox,
+ fpg_checkbox,
+ fpg_radiobutton,
+ fpg_panel,
+ fpg_editcombo;
type
diff --git a/examples/gui/customstyles/mystyle.pas b/examples/gui/customstyles/mystyle.pas
index 665a22b0..8ca00d33 100644
--- a/examples/gui/customstyles/mystyle.pas
+++ b/examples/gui/customstyles/mystyle.pas
@@ -1,4 +1,4 @@
-{
+(*
A very quick and basic style implementation. It took all of 10 minutes.
To apply this style, follow these instructions:
@@ -31,7 +31,7 @@
end;
end;
-}
+*)
unit mystyle;
{$mode objfpc}{$H+}
diff --git a/examples/gui/drag_n_drop/dndexample.lpr b/examples/gui/drag_n_drop/dndexample.lpr
index 13dda563..c95b97d0 100644
--- a/examples/gui/drag_n_drop/dndexample.lpr
+++ b/examples/gui/drag_n_drop/dndexample.lpr
@@ -81,7 +81,6 @@ procedure TMainForm.Bevel1DragEnter(Sender, Source: TObject;
AMimeList: TStringList; var AMimeChoice: TfpgString;
var ADropAction: TfpgDropAction; var Accept: Boolean);
var
- i: integer;
s: string;
begin
{ the mime type we want to accept }
@@ -108,7 +107,6 @@ procedure TMainForm.PanelDragDrop(Sender, Source: TObject; X, Y: integer;
AData: Variant);
var
s: string;
- v: variant;
begin
s := AData;
Bevel1.Text := Format('Drop event at (%d,%d) with value(s):'+LineEnding+'%s', [X, Y, s]);
@@ -129,7 +127,6 @@ procedure TMainForm.LabelDragStartDetected(Sender: TObject);
var
m: TfpgMimeData;
d: TfpgDrag;
- v: variant;
begin
m := TfpgMimeData.Create;
diff --git a/examples/gui/embedded_form/frm_main.pas b/examples/gui/embedded_form/frm_main.pas
index 785247c9..e2fb0f0e 100644
--- a/examples/gui/embedded_form/frm_main.pas
+++ b/examples/gui/embedded_form/frm_main.pas
@@ -56,6 +56,7 @@ var
var
j: integer;
begin
+ Result := '';
if indent = 0 then
exit;
for j := 1 to indent do
diff --git a/examples/gui/filedialog/filedialog.lpr b/examples/gui/filedialog/filedialog.lpr
index e1dca3d7..315b7885 100644
--- a/examples/gui/filedialog/filedialog.lpr
+++ b/examples/gui/filedialog/filedialog.lpr
@@ -105,6 +105,7 @@ procedure TMainForm.btnUserInputClicked(Sender: TObject);
var
lAnswer: TfpgString;
begin
+ lAnswer := '';
if fpgInputQuery('Caption here', 'And the prompt goes here', lAnswer) then
ShowMessage(Format('User entered <%s>', [lAnswer]));
end;
diff --git a/examples/gui/listbox/frm_main.pas b/examples/gui/listbox/frm_main.pas
index 1c858112..cacc604f 100644
--- a/examples/gui/listbox/frm_main.pas
+++ b/examples/gui/listbox/frm_main.pas
@@ -5,13 +5,15 @@ 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_basegrid, 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_button,
+ fpg_listbox,
+ fpg_memo,
+ fpg_checkbox;
type
diff --git a/examples/gui/splashscreen/frm_main.pas b/examples/gui/splashscreen/frm_main.pas
index 7ecf663c..61155fae 100644
--- a/examples/gui/splashscreen/frm_main.pas
+++ b/examples/gui/splashscreen/frm_main.pas
@@ -49,7 +49,6 @@ type
implementation
uses
- fpg_command_intf,
commands;
{@VFD_NEWFORM_IMPL}