summaryrefslogtreecommitdiff
path: root/examples/apps
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2010-09-20 13:06:28 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2010-09-20 13:06:28 +0200
commitfbbfbc141722f9a25f3ad67871feb2a604dde712 (patch)
tree0019e11d8c7543ad862c041abcd81fe995ca0698 /examples/apps
parentaa2cc53f0dc07a7f43d3dbc6e5c607fc9401c1b9 (diff)
downloadfpGUI-fbbfbc141722f9a25f3ad67871feb2a604dde712.tar.xz
A cool little "spinning globe" sample application
Programmers must have fun every now and again! :-)
Diffstat (limited to 'examples/apps')
-rw-r--r--examples/apps/globe/extrafpc.cfg6
-rw-r--r--examples/apps/globe/frm_main.pas669
-rw-r--r--examples/apps/globe/globe.lpi86
-rw-r--r--examples/apps/globe/globe.lpr29
-rw-r--r--examples/apps/globe/globe_data.inc1567
-rw-r--r--examples/apps/globe/images.inc52
-rw-r--r--examples/apps/globe/images/toggle_grid.bmpbin0 -> 822 bytes
-rw-r--r--examples/apps/globe/units/placeholder.txt0
8 files changed, 2409 insertions, 0 deletions
diff --git a/examples/apps/globe/extrafpc.cfg b/examples/apps/globe/extrafpc.cfg
new file mode 100644
index 00000000..bf32f456
--- /dev/null
+++ b/examples/apps/globe/extrafpc.cfg
@@ -0,0 +1,6 @@
+-FUunits
+-Fu../../../lib/$fpctarget
+-Fi.
+-Xs
+-XX
+-CX
diff --git a/examples/apps/globe/frm_main.pas b/examples/apps/globe/frm_main.pas
new file mode 100644
index 00000000..ed470ee5
--- /dev/null
+++ b/examples/apps/globe/frm_main.pas
@@ -0,0 +1,669 @@
+unit frm_main;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+ SysUtils, Classes, fpg_base, fpg_main, fpg_widget, fpg_form, fpg_menu,
+ fpg_panel, fpg_button, fpg_stdimages;
+
+
+{$I globe_data.inc}
+{$I images.inc}
+
+type
+ TGlobe = class(TfpgWidget)
+ private
+ FShowGrid: boolean;
+ FGridStep: integer;
+ R, Fi, Th, Wfi, Wth, Y, X, Xold, Yold: integer;
+ CosFi, SinFi: Double; { Fi is longitude }
+ CosTh, SinTh: Double; { Th is latitude }
+ CosWth, SinWth: Double;
+ procedure DrawSpace;
+ procedure DrawGlobe;
+ procedure DrawGrid;
+ procedure DrawSegment;
+ procedure Convert;
+ function GetRadius: integer;
+ procedure SetRadius(const AValue: integer);
+ procedure SetShowGrid(const AValue: boolean);
+ procedure SetGridStep(const AValue: integer);
+ protected
+ procedure HandlePaint; override;
+ public
+ constructor Create(AOwner: TComponent); override;
+ procedure SetViewPoint(const ALon, ALat: integer);
+ property GridStep: integer read FGridStep write SetGridStep default 5;
+ property ShowGrid: boolean read FShowGrid write SetShowGrid default True;
+ property Radius: integer read GetRadius write SetRadius default 150;
+ end;
+
+
+ TMainForm = class(TfpgForm)
+ private
+ {@VFD_HEAD_BEGIN: MainForm}
+ MainMenu: TfpgMenuBar;
+ Globe1: TGlobe;
+ pmFile: TfpgPopupMenu;
+ pmView: TfpgPopupMenu;
+ pmHelp: TfpgPopupMenu;
+ StatusPanel: TfpgPanel;
+ Bevel1: TfpgBevel;
+ btnQuit: TfpgButton;
+ btnGrid: TfpgButton;
+ btnZoomIn: TfpgButton;
+ btnZoomOut: TfpgButton;
+ btnHelp: TfpgButton;
+ {@VFD_HEAD_END: MainForm}
+ miShowGrid: TfpgMenuItem;
+ FShowGrid: boolean;
+ FWfi: integer;
+ FWth: integer;
+ FStep: integer;
+ procedure FormKeyPressed(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean);
+ procedure miFileQuitClicked(Sender: TObject);
+ procedure miShowGridClicked(Sender: TObject);
+ procedure miZoomInClicked(Sender: TObject);
+ procedure miZoomOutClicked(Sender: TObject);
+ procedure btnHelpClicked(Sender: TObject);
+ procedure miHelpAbout(Sender: TObject);
+ procedure miHelpAboutFPGui(Sender: TObject);
+ procedure UpdateStatus;
+ procedure MoveWest;
+ procedure MoveEast;
+ procedure MoveNorth;
+ procedure MoveSouth;
+ public
+ constructor Create(AOwner: TComponent); override;
+ procedure AfterCreate; override;
+ end;
+
+{@VFD_NEWFORM_DECL}
+
+implementation
+
+uses
+ fpg_dialogs, math;
+
+{@VFD_NEWFORM_IMPL}
+
+procedure TMainForm.FormKeyPressed(Sender: TObject; var KeyCode: word;
+ var ShiftState: TShiftState; var Consumed: boolean);
+begin
+ case KeyCode of
+ 81: // Q key
+ begin
+ Consumed := True;
+// if ShiftState = [ssCtrl] then
+ Close;
+ end;
+ keyUp:
+ begin
+ MoveNorth;
+ Consumed := True;
+ end;
+ keyDown:
+ begin
+ MoveSouth;
+ Consumed := True;
+ end;
+ keyLeft:
+ begin
+ MoveWest;
+ Consumed := True;
+ end;
+ keyRight:
+ begin
+ MoveEast;
+ Consumed := True;
+ end;
+ 71: // g key
+ begin
+ Consumed := True;
+ miShowGridClicked(nil);
+ end;
+ 73: // i key
+ begin
+ Consumed := True;
+ miZoomInClicked(nil);
+ end;
+ 79: // o key
+ begin
+ Consumed := True;
+ miZoomOutClicked(nil);
+ end;
+ keyF1:
+ begin
+ Consumed := True;
+ btnHelpClicked(nil);
+ end;
+ keyF11:
+ begin
+ Consumed := True;
+ miHelpAboutFPGui(nil);
+ end;
+ keyF12:
+ begin
+ Consumed := True;
+ miHelpAbout(nil);
+ end;
+ end;
+end;
+
+procedure TMainForm.miFileQuitClicked(Sender: TObject);
+begin
+ Close;
+end;
+
+procedure TMainForm.miShowGridClicked(Sender: TObject);
+begin
+ FShowGrid := not FShowGrid;
+ miShowGrid.Checked := FShowGrid;
+ btnGrid.Down := FShowGrid;
+ Globe1.ShowGrid := FShowGrid;
+end;
+
+procedure TMainForm.miZoomInClicked(Sender: TObject);
+var
+ r: integer;
+begin
+ r := Globe1.Radius;
+ if r < 1000 then
+ r := r + 50;
+ Globe1.Radius := r;
+end;
+
+procedure TMainForm.miZoomOutClicked(Sender: TObject);
+var
+ r: integer;
+begin
+ r := Globe1.Radius;
+ if r > 50 then
+ r := r - 50;
+ Globe1.Radius := r;
+end;
+
+procedure TMainForm.btnHelpClicked(Sender: TObject);
+var
+ frm: TfpgMessageBox;
+begin
+ frm := TfpgMessageBox.Create(nil);
+ try
+ frm.WindowTitle := 'Keyboard Help';
+ frm.CentreText := False;
+ frm.FontDesc := '#Edit2'; // mono font
+ frm.SetMessage(
+ 'G: Toggles the grid' + LineEnding
+ + 'I: Zoom in' + LineEnding
+ + 'O: Zoom out' + LineEnding
+ + 'Q: Quit the application' + LineEnding
+ + 'F1: Shows this help' + LineEnding
+ + 'F11: About fpGUI Toolkit' + LineEnding
+ + 'F12: About this program');
+ frm.ShowModal;
+ finally
+ frm.Free;
+ end;
+end;
+
+procedure TMainForm.miHelpAbout(Sender: TObject);
+begin
+ ShowMessage('fpgGUI Globe written by Graeme Geldenhuys - 2010', 'About...', True);
+end;
+
+procedure TMainForm.miHelpAboutFPGui(Sender: TObject);
+begin
+ TfpgMessageDialog.AboutFPGui('');
+end;
+
+procedure TMainForm.UpdateStatus;
+var
+ fi, th: integer;
+ ew, ns: TfpgString;
+begin
+ if FWth >= 0 then
+ begin
+ th := FWth;
+ ns := 'N';
+ end
+ else
+ begin
+ th := - FWth;
+ ns := 'S';
+ end;
+ fi := FWfi mod 360;
+ if (fi > 180) then
+ fi := fi - 360
+ else if (fi < -180) then
+ fi := fi + 360;
+ if fi >= 0 then
+ ew := 'E'
+ else
+ begin
+ fi := -fi;
+ ew := 'W';
+ end;
+ StatusPanel.Text := Format('View Point: %d %s, %d %s', [th, ns, fi, ew]);
+end;
+
+procedure TMainForm.MoveWest;
+begin
+ FWfi := FWfi - FStep;
+ FWfi := FWfi mod 360;
+ Globe1.SetViewPoint(FWfi, FWth);
+ UpdateStatus;
+end;
+
+procedure TMainForm.MoveEast;
+begin
+ FWfi := FWfi + FStep;
+ FWfi := FWfi mod 360;
+ Globe1.SetViewPoint(FWfi, FWth);
+ UpdateStatus;
+end;
+
+procedure TMainForm.MoveNorth;
+begin
+ if FWth <= (90-FStep) then
+ FWth := FWth + FStep
+ else
+ FWth := 90;
+ Globe1.SetViewPoint(FWfi, FWth);
+ UpdateStatus;
+end;
+
+procedure TMainForm.MoveSouth;
+begin
+ if FWth >= (FStep-90) then
+ FWth := FWth - FStep
+ else
+ FWth := -90;
+ Globe1.SetViewPoint(FWfi, FWth);
+ UpdateStatus;
+end;
+
+constructor TMainForm.Create(AOwner: TComponent);
+begin
+ inherited Create(AOwner);
+ FStep := 5;
+ FShowGrid := True;
+ OnKeyPress := @FormKeyPressed;
+ fpgImages.AddMaskedBMP( // 16x16 image
+ 'usr.toggle_grid',
+ @usr_toggle_grid,
+ sizeof(usr_toggle_grid), 0, 0);
+end;
+
+procedure TMainForm.AfterCreate;
+begin
+ {%region 'Auto-generated GUI code' -fold}
+ {@VFD_BODY_BEGIN: MainForm}
+ Name := 'MainForm';
+ SetPosition(357, 219, 363, 430);
+ WindowTitle := 'fpGUI Globe';
+ WindowPosition := wpOneThirdDown;
+ ShowHint := True;
+
+ MainMenu := TfpgMenuBar.Create(self);
+ with MainMenu do
+ begin
+ Name := 'MainMenu';
+ SetPosition(0, 0, 363, 24);
+ Anchors := [anLeft,anRight,anTop];
+ end;
+
+ Globe1 := TGlobe.Create(self);
+ with Globe1 do
+ begin
+ Name := 'Globe1';
+ SetPosition(7, 64, 350, 330);
+ Anchors := [anLeft,anRight,anTop,anBottom];
+ // OnKeyPress := @FormKeyPressed;
+ end;
+
+ pmFile := TfpgPopupMenu.Create(self);
+ with pmFile do
+ begin
+ Name := 'pmFile';
+ SetPosition(248, 36, 120, 20);
+ AddMenuItem('&Quit', 'Q', @miFileQuitClicked);
+ end;
+
+ pmView := TfpgPopupMenu.Create(self);
+ with pmView do
+ begin
+ Name := 'pmView';
+ SetPosition(248, 56, 120, 20);
+ miShowGrid := AddMenuItem('Show Grid', '', @miShowGridClicked);
+ miShowGrid.Checked := True;
+ AddMenuItem('Zoom In', '', @miZoomInClicked);
+ AddMenuItem('Zoom Out', '', @miZoomOutClicked);
+ end;
+
+ pmHelp := TfpgPopupMenu.Create(self);
+ with pmHelp do
+ begin
+ Name := 'pmHelp';
+ SetPosition(248, 76, 120, 20);
+ AddMenuItem('Keyboard Shortcuts...', 'F1', @btnHelpClicked);
+ AddMenuItem('-', '', nil);
+ AddMenuItem('About fpGUI Toolkit...', 'F11', @miHelpAboutFPGui);
+ AddMenuItem('About...', 'F12', @miHelpAbout);
+ end;
+
+ StatusPanel := TfpgPanel.Create(self);
+ with StatusPanel do
+ begin
+ Name := 'StatusPanel';
+ SetPosition(1, 405, 363, 24);
+ Anchors := [anLeft,anRight,anBottom];
+ Alignment := taLeftJustify;
+ FontDesc := '#Label1';
+ Hint := '';
+ Style := bsLowered;
+ Text := 'Ready.';
+ end;
+
+ Bevel1 := TfpgBevel.Create(self);
+ with Bevel1 do
+ begin
+ Name := 'Bevel1';
+ SetPosition(0, 24, 363, 28);
+ Anchors := [anLeft,anRight,anTop];
+ Hint := '';
+ Style := bsLowered;
+ Shape := bsBottomLine;
+ end;
+
+ btnQuit := TfpgButton.Create(Bevel1);
+ with btnQuit do
+ begin
+ Name := 'btnQuit';
+ SetPosition(4, 1, 24, 24);
+ Text := '';
+ FontDesc := '#Label1';
+ Hint := 'Quit the application';
+ ImageMargin := -1;
+ ImageName := 'stdimg.quit';
+ ImageSpacing := 0;
+ TabOrder := 1;
+ Focusable := False;
+ OnClick := @miFileQuitClicked;
+ end;
+
+ btnGrid := TfpgButton.Create(Bevel1);
+ with btnGrid do
+ begin
+ Name := 'btnGrid';
+ SetPosition(32, 1, 24, 24);
+ Text := '';
+ AllowAllUp := True;
+ FontDesc := '#Label1';
+ GroupIndex := 1;
+ Hint := 'Toggle the grid on or off';
+ ImageMargin := -1;
+ ImageName := 'usr.toggle_grid';
+ ImageSpacing := 0;
+ TabOrder := 2;
+ Focusable := False;
+ Down := True;
+ OnClick := @miShowGridClicked;
+ end;
+
+ btnZoomIn := TfpgButton.Create(Bevel1);
+ with btnZoomIn do
+ begin
+ Name := 'btnZoomIn';
+ SetPosition(60, 1, 24, 24);
+ Text := '';
+ FontDesc := '#Label1';
+ Hint := 'Zoom in';
+ ImageMargin := -1;
+ ImageName := 'stdimg.add';
+ ImageSpacing := 0;
+ TabOrder := 3;
+ Focusable := False;
+ OnClick := @miZoomInClicked;
+ end;
+
+ btnZoomOut := TfpgButton.Create(Bevel1);
+ with btnZoomOut do
+ begin
+ Name := 'btnZoomOut';
+ SetPosition(84, 1, 24, 24);
+ Text := '';
+ FontDesc := '#Label1';
+ Hint := 'Zoom out';
+ ImageMargin := -1;
+ ImageName := 'stdimg.remove';
+ ImageSpacing := 0;
+ TabOrder := 4;
+ Focusable := False;
+ OnClick := @miZoomOutClicked;
+ end;
+
+ btnHelp := TfpgButton.Create(Bevel1);
+ with btnHelp do
+ begin
+ Name := 'btnHelp';
+ SetPosition(112, 1, 24, 24);
+ Text := '';
+ FontDesc := '#Label1';
+ Hint := 'Keyboard shortcut help';
+ ImageMargin := -1;
+ ImageName := 'stdimg.help';
+ ImageSpacing := 0;
+ TabOrder := 5;
+ Focusable := False;
+ OnClick := @btnHelpClicked;
+ end;
+
+ {@VFD_BODY_END: MainForm}
+ {%endregion}
+
+ { hook up the menus to menu bar }
+ MainMenu.AddMenuItem('&File', nil).SubMenu := pmFile;
+ MainMenu.AddMenuItem('&View', nil).SubMenu := pmView;
+ MainMenu.AddMenuItem('&Help', nil).SubMenu := pmHelp;
+end;
+
+
+{ TGlobe }
+
+procedure TGlobe.DrawSpace;
+var
+ i: integer;
+begin
+ Canvas.Color := clGray; //clNavy;
+ i := 0;
+ while i < R do
+ begin
+ X := Trunc(R - (sqrt(R*R - (R-i)*(R-i) )) - 0.5);
+ Canvas.DrawLine(0, i, X, i);
+ Canvas.DrawLine(2*R-X, i, 2*R, i);
+ Canvas.DrawLine(0, 2*R-i, X, 2*R-i);
+ Canvas.DrawLine(2*R-X, 2*R-i, 2*R, 2*R-i);
+ inc(i, 2);
+ end;
+end;
+
+procedure TGlobe.DrawGlobe;
+var
+ i: integer;
+begin
+ DrawSpace;
+ Canvas.Color := clGreen;
+
+ CosWth := cos(degtorad(Wth));
+ SinWth := sin(degtorad(Wth));
+ i := 0;
+
+ Fi := globe_data[i];
+ inc(i);
+ Th := globe_data[i];
+ inc(i);
+ Convert;
+ Xold := X;
+ Yold := Y;
+
+ { plot }
+ while i < Length(globe_data) do
+ begin
+ Fi := globe_data[i];
+ inc(i);
+ Th := globe_data[i];
+ inc(i);
+ if (Fi <> 0) or (Th <> 0) then
+ begin
+ Convert;
+ DrawSegment;
+ Xold := X;
+ Yold := Y;
+ continue;
+ end;
+
+ if i = Length(globe_data) then
+ break;
+
+ Fi := globe_data[i];
+ inc(i);
+ Th := globe_data[i];
+ inc(i);
+ Convert;
+ Xold := X;
+ Yold := Y;
+ end;
+
+ if FShowGrid then
+ DrawGrid;
+end;
+
+procedure TGlobe.DrawGrid;
+var
+ temp: integer;
+begin
+ Canvas.Color := TfpgColor($8080FF); // clGray;
+ Canvas.SetLineStyle(0, lsDash);
+ { Parallels }
+ temp := Wfi;
+ Wfi := 0;
+ Th := -90+GridStep;
+ while Th < 90 do
+ begin
+ Fi := -180;
+ Convert;
+ Xold := X;
+ Yold := Y;
+ while Fi < 180 do
+ begin
+ Fi := Fi + 6;
+ Convert;
+ DrawSegment;
+ Xold := X;
+ Yold := Y;
+ end;
+ inc(Th, GridStep);
+ end;
+
+ Wfi := temp;
+ Fi := -180;
+ { Meridians }
+ while Fi < 180 do
+ begin
+ Th := -84;
+ Convert;
+ Xold := X;
+ Yold := Y;
+ while Th < 84 do
+ begin
+ Th := Th + 6;
+ Convert;
+ DrawSegment;
+ Xold := X;
+ Yold := Y;
+ end;
+ inc(Fi, GridStep);
+ end;
+end;
+
+procedure TGlobe.DrawSegment;
+begin
+ if (CosFi * CosTh * CosWth + SinTh * SinWth) > 0.0 then
+ Canvas.DrawLine(Xold+R, Yold+R, X+R, Y+R);
+end;
+
+procedure TGlobe.Convert;
+var
+ dFi: integer;
+begin
+ dFi := Fi - Wfi;
+
+ CosFi := cos(degtorad(dFi));
+ SinFi := sin(degtorad(dFi));
+ CosTh := cos(degtorad(Th));
+ SinTh := sin(degtorad(Th));
+
+ X := Trunc(CosTh * SinFi * R);
+ Y := Trunc((CosFi * CosTh * SinWth - SinTh * CosWth) * R);
+end;
+
+function TGlobe.GetRadius: integer;
+begin
+ Result := R;
+end;
+
+procedure TGlobe.SetRadius(const AValue: integer);
+begin
+ R := AValue;
+ Repaint;
+end;
+
+procedure TGlobe.SetShowGrid(const AValue: boolean);
+begin
+ if FShowGrid=AValue then exit;
+ FShowGrid:=AValue;
+ Repaint;
+end;
+
+procedure TGlobe.SetGridStep(const AValue: integer);
+begin
+ if FGridStep = AValue then exit;
+ FGridStep := AValue;
+ if FShowGrid then
+ Repaint;
+end;
+
+procedure TGlobe.HandlePaint;
+begin
+ Canvas.BeginDraw;
+ Canvas.Clear(clWindowBackground);
+// R := Width div 2;
+ // inherited HandlePaint;
+ DrawGlobe;
+ Canvas.EndDraw;
+end;
+
+constructor TGlobe.Create(AOwner: TComponent);
+begin
+ inherited Create(AOwner);
+ FFocusable := True;
+ FGridStep := 15;
+ FShowGrid := True;
+ R := 150;
+end;
+
+procedure TGlobe.SetViewPoint(const ALon, ALat: integer);
+begin
+ if ALat < -90 then
+ Wth := -90
+ else if ALat > 90 then
+ Wth := 90
+ else
+ Wth := ALat;
+ Wfi := ALon mod 360;
+ Repaint;
+end;
+
+end.
diff --git a/examples/apps/globe/globe.lpi b/examples/apps/globe/globe.lpi
new file mode 100644
index 00000000..066bca8c
--- /dev/null
+++ b/examples/apps/globe/globe.lpi
@@ -0,0 +1,86 @@
+<?xml version="1.0"?>
+<CONFIG>
+ <ProjectOptions>
+ <Version Value="9"/>
+ <General>
+ <Flags>
+ <SaveOnlyProjectUnits Value="True"/>
+ <MainUnitHasCreateFormStatements Value="False"/>
+ <MainUnitHasTitleStatement Value="False"/>
+ </Flags>
+ <SessionStorage Value="InProjectDir"/>
+ <MainUnit Value="0"/>
+ <UseAppBundle Value="False"/>
+ </General>
+ <VersionInfo>
+ <Language Value=""/>
+ <CharSet Value=""/>
+ <StringTable 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="4">
+ <Unit0>
+ <Filename Value="globe.lpr"/>
+ <IsPartOfProject Value="True"/>
+ <UnitName Value="globe"/>
+ </Unit0>
+ <Unit1>
+ <Filename Value="frm_main.pas"/>
+ <IsPartOfProject Value="True"/>
+ <UnitName Value="frm_main"/>
+ </Unit1>
+ <Unit2>
+ <Filename Value="globe_data.inc"/>
+ <IsPartOfProject Value="True"/>
+ </Unit2>
+ <Unit3>
+ <Filename Value="images.inc"/>
+ <IsPartOfProject Value="True"/>
+ </Unit3>
+ </Units>
+ </ProjectOptions>
+ <CompilerOptions>
+ <Version Value="9"/>
+ <Target>
+ <Filename Value="globe"/>
+ </Target>
+ <SearchPaths>
+ <UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/>
+ </SearchPaths>
+ <Other>
+ <CompilerMessages>
+ <UseMsgFile Value="True"/>
+ </CompilerMessages>
+ <CompilerPath Value="$(CompPath)"/>
+ </Other>
+ </CompilerOptions>
+ <Debugging>
+ <Exceptions Count="3">
+ <Item1>
+ <Name Value="EAbort"/>
+ </Item1>
+ <Item2>
+ <Name Value="ECodetoolError"/>
+ </Item2>
+ <Item3>
+ <Name Value="EFOpenError"/>
+ </Item3>
+ </Exceptions>
+ </Debugging>
+</CONFIG>
diff --git a/examples/apps/globe/globe.lpr b/examples/apps/globe/globe.lpr
new file mode 100644
index 00000000..02af6132
--- /dev/null
+++ b/examples/apps/globe/globe.lpr
@@ -0,0 +1,29 @@
+program globe;
+
+{$mode objfpc}{$H+}
+
+uses
+ {$IFDEF UNIX}{$IFDEF UseCThreads}
+ cthreads,
+ {$ENDIF}{$ENDIF}
+ Classes, fpg_main, fpg_form, 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/globe/globe_data.inc b/examples/apps/globe/globe_data.inc
new file mode 100644
index 00000000..56bb0207
--- /dev/null
+++ b/examples/apps/globe/globe_data.inc
@@ -0,0 +1,1567 @@
+
+
+// Data array for continents, as a sequence of connected line segment
+// (polylines). Segment end coordinates are in degrees, each pair
+// representing the absolute latitude and longitude respectively,
+// West and South are negative. The step between break-points is
+// not greather than 7 degree. The end of a sequence is represented
+// by 0,0.
+
+// The data order is the following: Africa, Europe, Asia,
+// South America, North America, Australia and Antartic.
+
+const
+ globe_data: array[0..3093] of integer = (
+ 33, 28,
+ 35, 25,
+ 37, 22,
+ 38, 18,
+ 40, 15,
+ 43, 13,
+ 44, 11,
+ 45, 10,
+ 52, 12,
+ 51, 10,
+ 48, 6,
+ 46, 2,
+ 44, 1,
+ 38, -6,
+ 39, -7,
+ 39, -9,
+ 41, -11,
+ 41, -15,
+ 39, -17,
+ 37, -18,
+ 35, -20,
+ 36, -24,
+ 33, -26,
+ 32, -29,
+ 29, -32,
+ 26, -34,
+ 21, -34,
+ 20, -35,
+ 18, -33,
+ 18, -31,
+ 15, -26,
+ 14, -22,
+ 12, -18,
+ 12, -16,
+ 13, -13,
+ 14, -12,
+ 14, -11,
+ 12, -5,
+ 9, -1,
+ 10, 3,
+ 8, 5,
+ 6, 4,
+ 5, 6,
+ 4, 7,
+ -2, 5,
+ -6, 5,
+ -8, 4,
+ -13, 8,
+ -13, 9,
+ -17, 13,
+ -18, 15,
+ -17, 17,
+ -17, 20,
+ -18, 21,
+ -18, 22,
+ -14, 26,
+ -13, 28,
+ -10, 30,
+ -10, 32,
+ -9, 33,
+ -7, 34,
+ -5, 36,
+ -4, 35,
+ -2, 35,
+ 0, 36,
+ 4, 37,
+ 11, 37,
+ 10, 34,
+ 13, 33,
+ 15, 32,
+ 19, 30,
+ 20, 31,
+ 20, 32,
+ 21, 33,
+ 23, 33,
+ 23, 32,
+ 29, 31,
+ 31, 32,
+ 33, 31,
+ 0, 0,
+ 50, -13,
+ 50, -16,
+ 47, -25,
+ 45, -26,
+ 44, -25,
+ 43, -22,
+ 44, -19,
+ 44, -17,
+ 45, -16,
+ 46, -16,
+ 49, -12,
+ 50, -13,
+ 0, 0,
+ 34, 0,
+ 34, -1,
+ 33, -2,
+ 32, -2,
+ 32, 0,
+ 34, 0,
+ 0, 0,
+ 13, 14,
+ 14, 14,
+ 15, 13,
+ 14, 13,
+ 14, 12,
+ 13, 14,
+ 0, 0,
+ 33, 31,
+ 34, 31,
+ 36, 35,
+ 36, 37,
+ 35, 37,
+ 33, 36,
+ 31, 37,
+ 30, 38,
+ 27, 37,
+ 26, 39,
+ 26, 40,
+ 29, 41,
+ 0, 0,
+ 32, 35,
+ 34, 35,
+ 35, 36,
+ 32, 35,
+ 0, 0,
+ 26, 35,
+ 24, 36,
+ 25, 35,
+ 26, 35,
+ 0, 0,
+ 29, 41,
+ 31, 41,
+ 33, 42,
+ 35, 42,
+ 38, 41,
+ 40, 41,
+ 42, 42,
+ 42, 43,
+ 37, 45,
+ 39, 47,
+ 35, 46,
+ 37, 45,
+ 34, 44,
+ 33, 45,
+ 34, 46,
+ 31, 47,
+ 30, 45,
+ 28, 43,
+ 28, 42,
+ 29, 41,
+ 28, 41,
+ 26, 40,
+ 26, 41,
+ 24, 41,
+ 24, 40,
+ 23, 40,
+ 23, 39,
+ 25, 38,
+ 23, 37,
+ 23, 36,
+ 21, 38,
+ 21, 39,
+ 20, 40,
+ 19, 42,
+ 15, 44,
+ 15, 45,
+ 14, 45,
+ 14, 46,
+ 12, 45,
+ 15, 42,
+ 16, 42,
+ 17, 41,
+ 18, 40,
+ 17, 40,
+ 17, 39,
+ 16, 38,
+ 12, 38,
+ 14, 37,
+ 15, 37,
+ 15, 38,
+ 16, 39,
+ 16, 40,
+ 12, 42,
+ 10, 44,
+ 8, 44,
+ 6, 43,
+ 3, 43,
+ 3, 42,
+ 1, 41,
+ 0, 40,
+ 0, 39,
+ -2, 37,
+ -4, 37,
+ -6, 36,
+ -7, 37,
+ -9, 37,
+ -9, 38,
+ -10, 39,
+ -9, 41,
+ -9, 43,
+ -8, 44,
+ -2, 43,
+ -1, 45,
+ -1, 46,
+ -2, 47,
+ -5, 48,
+ -3, 49,
+ -2, 49,
+ -2, 50,
+ 0, 49,
+ 2, 51,
+ 1, 51,
+ -5, 50,
+ -6, 50,
+ -4, 51,
+ -3, 51,
+ -5, 52,
+ -3, 54,
+ -5, 55,
+ -5, 56,
+ -6, 55,
+ -8, 55,
+ -9, 54,
+ -10, 54,
+ -10, 53,
+ -9, 53,
+ -10, 52,
+ -10, 51,
+ -7, 52,
+ -6, 53,
+ -6, 59,
+ -7, 57,
+ -6, 57,
+ -5, 58,
+ -3, 59,
+ -3, 58,
+ -2, 58,
+ -3, 56,
+ -2, 56,
+ 0, 54,
+ 0, 53,
+ 2, 53,
+ 2, 52,
+ 1, 52,
+ 2, 51,
+ 5, 53,
+ 9, 54,
+ 8, 57,
+ 11, 58,
+ 11, 57,
+ 10, 55,
+ 12, 55,
+ 12, 56,
+ 11, 56,
+ 11, 54,
+ 14, 55,
+ 14, 54,
+ 18, 55,
+ 21, 55,
+ 21, 57,
+ 23, 58,
+ 24, 57,
+ 25, 58,
+ 22, 59,
+ 22, 58,
+ 26, 60,
+ 30, 60,
+ 28, 61,
+ 25, 60,
+ 22, 60,
+ 21, 61,
+ 21, 63,
+ 25, 65,
+ 24, 66,
+ 23, 66,
+ 21, 64,
+ 17, 62,
+ 17, 61,
+ 19, 60,
+ 17, 58,
+ 16, 56,
+ 13, 56,
+ 13, 57,
+ 11, 59,
+ 8, 58,
+ 7, 58,
+ 6, 59,
+ 5, 62,
+ 10, 64,
+ 12, 65,
+ 15, 68,
+ 16, 69,
+ 19, 70,
+ 24, 71,
+ 28, 71,
+ 31, 70,
+ 29, 70,
+ 34, 69,
+ 36, 69,
+ 40, 68,
+ 41, 67,
+ 38, 66,
+ 37, 66,
+ 33, 67,
+ 35, 66,
+ 35, 64,
+ 38, 63,
+ 38, 64,
+ 36, 65,
+ 37, 65,
+ 40, 64,
+ 40, 66,
+ 43, 67,
+ 44, 67,
+ 43, 69,
+ 46, 69,
+ 47, 68,
+ 45, 67,
+ 48, 67,
+ 49, 68,
+ 54, 69,
+ 54, 68,
+ 59, 69,
+ 60, 68,
+ 61, 69,
+ 58, 71,
+ 56, 72,
+ 57, 73,
+ 54, 73,
+ 54, 74,
+ 56, 75,
+ 62, 76,
+ 64, 76,
+ 67, 77,
+ 69, 77,
+ 69, 76,
+ 60, 74,
+ 57, 73,
+ 54, 73,
+ 52, 72,
+ 55, 71,
+ 58, 71,
+ 60, 70,
+ 61, 70,
+ 68, 68,
+ 0, 0,
+ 10, 41,
+ 10, 39,
+ 9, 39,
+ 10, 43,
+ 9, 42,
+ 10, 41,
+ 0, 0,
+ 4, 40,
+ 4, 39,
+ 3, 39,
+ 4, 40,
+ 0, 0,
+ -16, 64,
+ -19, 63,
+ -23, 64,
+ -22, 65,
+ -24, 65,
+ -24, 66,
+ -22, 67,
+ -21, 66,
+ -21, 65,
+ -20, 66,
+ -17, 66,
+ -16, 67,
+ -13, 65,
+ -16, 64,
+ 0, 0,
+ -45, 60,
+ -47, 61,
+ -48, 61,
+ -51, 63,
+ -54, 67,
+ -53, 68,
+ -51, 68,
+ -51, 70,
+ -55, 70,
+ -54, 69,
+ -52, 69,
+ -54, 71,
+ -52, 71,
+ -53, 72,
+ -56, 72,
+ -59, 76,
+ -62, 77,
+ -68, 77,
+ -71, 78,
+ -72, 79,
+ -65, 80,
+ -67, 80,
+ -59, 82,
+ -51, 82,
+ -43, 83,
+ -34, 83,
+ -28, 83,
+ -20, 82,
+ -22, 81,
+ -17, 81,
+ -12, 81,
+ -20, 80,
+ -20, 73,
+ -22, 72,
+ -21, 70,
+ -27, 69,
+ -32, 68,
+ -34, 66,
+ -40, 65,
+ -43, 60,
+ -45, 60,
+ 0, 0,
+ 68, 68,
+ 69, 69,
+ 67, 70,
+ 67, 72,
+ 69, 73,
+ 72, 73,
+ 71, 72,
+ 73, 68,
+ 72, 67,
+ 68, 66,
+ 72, 66,
+ 74, 67,
+ 74, 68,
+ 76, 68,
+ 78, 67,
+ 77, 69,
+ 74, 69,
+ 74, 71,
+ 73, 72,
+ 74, 73,
+ 75, 73,
+ 75, 72,
+ 78, 71,
+ 76, 72,
+ 80, 72,
+ 83, 71,
+ 81, 73,
+ 81, 74,
+ 86, 74,
+ 87, 75,
+ 93, 76,
+ 98, 76,
+ 101, 77,
+ 103, 78,
+ 105, 79,
+ 102, 80,
+ 99, 79,
+ 91, 80,
+ 98, 80,
+ 95, 81,
+ 92, 80,
+ 100, 80,
+ 100, 79,
+ 104, 79,
+ 108, 77,
+ 112, 77,
+ 114, 76,
+ 113, 75,
+ 105, 74,
+ 112, 74,
+ 118, 74,
+ 123, 73,
+ 123, 74,
+ 128, 73,
+ 129, 71,
+ 130, 71,
+ 133, 72,
+ 140, 72,
+ 140, 75,
+ 135, 76,
+ 138, 77,
+ 145, 76,
+ 150, 75,
+ 152, 76,
+ 147, 76,
+ 143, 75,
+ 140, 75,
+ 143, 74,
+ 140, 74,
+ 140, 73,
+ 148, 72,
+ 153, 71,
+ 159, 71,
+ 160, 70,
+ 167, 70,
+ 169, 69,
+ 172, 69,
+ 171, 70,
+ 176, 70,
+ -176, 68,
+ -174, 66,
+ -174, 67,
+ -172, 67,
+ -170, 66,
+ -173, 64,
+ -176, 65,
+ -176, 66,
+ -178, 66,
+ -178, 67,
+ 180, 65,
+ 176, 65,
+ 178, 64,
+ 179, 63,
+ 178, 62,
+ 177, 63,
+ 171, 61,
+ 170, 60,
+ 169, 61,
+ 163, 60,
+ 162, 58,
+ 163, 58,
+ 163, 56,
+ 162, 56,
+ 162, 55,
+ 160, 54,
+ 160, 53,
+ 158, 53,
+ 158, 52,
+ 157, 51,
+ 156, 56,
+ 157, 58,
+ 164, 61,
+ 164, 62,
+ 160, 61,
+ 160, 62,
+ 157, 62,
+ 154, 60,
+ 155, 59,
+ 153, 59,
+ 149, 60,
+ 149, 59,
+ 143, 59,
+ 135, 55,
+ 138, 54,
+ 140, 54,
+ 141, 53,
+ 141, 52,
+ 142, 51,
+ 142, 46,
+ 143, 47,
+ 144, 46,
+ 144, 47,
+ 143, 48,
+ 143, 49,
+ 144, 49,
+ 145, 48,
+ 143, 52,
+ 143, 54,
+ 142, 53,
+ 140, 48,
+ 136, 44,
+ 134, 43,
+ 133, 43,
+ 132, 44,
+ 130, 42,
+ 130, 41,
+ 128, 40,
+ 127, 39,
+ 129, 37,
+ 129, 35,
+ 126, 34,
+ 126, 38,
+ 125, 38,
+ 125, 39,
+ 124, 40,
+ 121, 39,
+ 122, 41,
+ 121, 41,
+ 119, 39,
+ 118, 39,
+ 118, 38,
+ 119, 38,
+ 119, 37,
+ 120, 37,
+ 121, 38,
+ 123, 37,
+ 119, 35,
+ 122, 32,
+ 122, 31,
+ 120, 30,
+ 122, 30,
+ 120, 26,
+ 116, 23,
+ 111, 21,
+ 109, 19,
+ 109, 18,
+ 110, 18,
+ 111, 20,
+ 110, 20,
+ 110, 22,
+ 108, 22,
+ 106, 20,
+ 106, 18,
+ 108, 15,
+ 109, 13,
+ 109, 11,
+ 105, 8,
+ 105, 10,
+ 103, 11,
+ 102, 13,
+ 101, 13,
+ 101, 14,
+ 100, 14,
+ 100, 12,
+ 99, 9,
+ 100, 9,
+ 101, 7,
+ 102, 7,
+ 103, 5,
+ 104, 3,
+ 105, 1,
+ 102, 3,
+ 100, 7,
+ 98, 8,
+ 98, 14,
+ 97, 17,
+ 95, 16,
+ 94, 16,
+ 94, 19,
+ 92, 23,
+ 87, 22,
+ 87, 20,
+ 82, 17,
+ 80, 16,
+ 80, 10,
+ 80, 6,
+ 81, 6,
+ 82, 7,
+ 82, 8,
+ 81, 9,
+ 80, 10,
+ 78, 8,
+ 77, 8,
+ 74, 15,
+ 73, 22,
+ 72, 21,
+ 70, 21,
+ 69, 22,
+ 71, 23,
+ 69, 23,
+ 67, 26,
+ 62, 25,
+ 57, 26,
+ 56, 27,
+ 55, 26,
+ 51, 28,
+ 50, 30,
+ 48, 30,
+ 47, 29,
+ 50, 27,
+ 50, 26,
+ 51, 25,
+ 51, 26,
+ 52, 26,
+ 52, 24,
+ 54, 24,
+ 56, 26,
+ 56, 25,
+ 57, 24,
+ 58, 23,
+ 60, 22,
+ 58, 19,
+ 57, 19,
+ 57, 18,
+ 55, 18,
+ 55, 17,
+ 52, 16,
+ 52, 15,
+ 45, 13,
+ 44, 13,
+ 42, 17,
+ 39, 22,
+ 35, 28,
+ 35, 29,
+ 34, 28,
+ 33, 30,
+ 33, 28,
+ 0, 0,
+ 50, 40,
+ 47, 43,
+ 47, 45,
+ 51, 47,
+ 53, 47,
+ 53, 46,
+ 52, 45,
+ 50, 45,
+ 52, 43,
+ 53, 43,
+ 53, 41,
+ 54, 42,
+ 55, 41,
+ 53, 41,
+ 53, 40,
+ 54, 39,
+ 54, 37,
+ 51, 37,
+ 49, 38,
+ 49, 39,
+ 50, 40,
+ 0, 0,
+ 62, 45,
+ 61, 44,
+ 58, 44,
+ 58, 45,
+ 59, 46,
+ 62, 47,
+ 61, 46,
+ 62, 45,
+ 0, 0,
+ 142, 40,
+ 142, 39,
+ 141, 38,
+ 141, 36,
+ 140, 35,
+ 140, 36,
+ 139, 35,
+ 137, 35,
+ 136, 34,
+ 135, 34,
+ 133, 33,
+ 132, 33,
+ 133, 34,
+ 135, 34,
+ 136, 35,
+ 132, 34,
+ 131, 34,
+ 132, 33,
+ 131, 31,
+ 130, 30,
+ 130, 33,
+ 129, 33,
+ 131, 34,
+ 132, 35,
+ 136, 36,
+ 137, 37,
+ 138, 37,
+ 140, 39,
+ 140, 43,
+ 142, 44,
+ 142, 46,
+ 144, 44,
+ 146, 43,
+ 144, 43,
+ 143, 42,
+ 142, 43,
+ 141, 43,
+ 141, 42,
+ 140, 41,
+ 141, 41,
+ 142, 40,
+ 0, 0,
+ 120, 24,
+ 121, 25,
+ 122, 25,
+ 121, 22,
+ 120, 23,
+ 120, 24,
+ 0, 0,
+ 120, 18,
+ 122, 18,
+ 122, 16,
+ 121, 15,
+ 122, 14,
+ 124, 14,
+ 124, 11,
+ 125, 10,
+ 126, 9,
+ 127, 8,
+ 126, 7,
+ 126, 6,
+ 124, 7,
+ 123, 8,
+ 122, 7,
+ 122, 8,
+ 124, 8,
+ 125, 10,
+ 125, 11,
+ 126, 11,
+ 125, 12,
+ 124, 12,
+ 122, 14,
+ 120, 14,
+ 121, 12,
+ 123, 11,
+ 123, 10,
+ 122, 10,
+ 124, 9,
+ 124, 10,
+ 124, 11,
+ 123, 11,
+ 122, 10,
+ 121, 12,
+ 120, 12,
+ 120, 11,
+ 117, 8,
+ 120, 10,
+ 120, 11,
+ 121, 12,
+ 121, 14,
+ 120, 15,
+ 119, 17,
+ 120, 16,
+ 120, 18,
+ 0, 0,
+ 95, 6,
+ 98, 5,
+ 101, 2,
+ 102, 2,
+ 104, 0,
+ 103, -1,
+ 104, -1,
+ 106, -3,
+ 107, -3,
+ 106, -2,
+ 106, -6,
+ 105, -7,
+ 111, -8,
+ 114, -8,
+ 115, -9,
+ 116, -8,
+ 117, -9,
+ 118, -9,
+ 120, -8,
+ 127, -8,
+ 125, -9,
+ 125, -10,
+ 123, -11,
+ 124, -9,
+ 125, -8,
+ 124, -8,
+ 119, -9,
+ 121, -10,
+ 119, -8,
+ 117, -8,
+ 116, -9,
+ 115, -8,
+ 114, -8,
+ 114, -7,
+ 108, -7,
+ 107, -6,
+ 104, -6,
+ 101, -3,
+ 99, 1,
+ 95, 5,
+ 95, 6,
+ 0, 0,
+ 110, 2,
+ 111, 2,
+ 111, 3,
+ 113, 3,
+ 116, 7,
+ 117, 6,
+ 118, 6,
+ 119, 5,
+ 117, 4,
+ 118, 2,
+ 119, 2,
+ 119, 1,
+ 118, 1,
+ 116, -3,
+ 115, -4,
+ 110, -3,
+ 109, 1,
+ 110, 2,
+ 0, 0,
+ 125, 2,
+ 125, 1,
+ 124, 0,
+ 121, 1,
+ 120, 0,
+ 121, -2,
+ 122, -1,
+ 123, -1,
+ 122, -2,
+ 123, -4,
+ 122, -6,
+ 123, -6,
+ 123, -5,
+ 122, -5,
+ 121, -4,
+ 121, -4,
+ 120, -3,
+ 120, -6,
+ 119, -6,
+ 119, -4,
+ 118, -4,
+ 118, -3,
+ 119, -1,
+ 120, 1,
+ 121, 2,
+ 122, 2,
+ 124, 1,
+ 125, 2,
+ 0, 0,
+ 131, -1,
+ 134, -1,
+ 135, -3,
+ 138, -1,
+ 144, -3,
+ 147, -5,
+ 151, -5,
+ 152, -4,
+ 153, -4,
+ 153, -5,
+ 151, -6,
+ 149, -6,
+ 148, -5,
+ 148, -6,
+ 147, -6,
+ 149, -9,
+ 151, -10,
+ 148, -10,
+ 146, -7,
+ 143, -8,
+ 144, -8,
+ 143, -9,
+ 141, -9,
+ 140, -8,
+ 138, -8,
+ 139, -7,
+ 138, -6,
+ 134, -4,
+ 133, -4,
+ 132, -3,
+ 134, -2,
+ 132, -2,
+ 131, -1,
+ 0, 0,
+ 164, -20,
+ 167, -22,
+ 166, -22,
+ 164, -21,
+ 164, -20,
+ 0, 0,
+ -77, 8,
+ -75, 11,
+ -72, 12,
+ -71, 12,
+ -72, 11,
+ -71, 9,
+ -72, 9,
+ -71, 11,
+ -70, 12,
+ -68, 11,
+ -66, 11,
+ -65, 10,
+ -64, 11,
+ -63, 11,
+ -62, 10,
+ -61, 10,
+ -61, 11,
+ -62, 10,
+ -61, 9,
+ -61, 8,
+ -57, 6,
+ -54, 6,
+ -51, 4,
+ -50, 1,
+ -51, 0,
+ -51, -1,
+ -50, 0,
+ -48, 0,
+ -49, -2,
+ -48, -1,
+ -44, -2,
+ -44, -3,
+ -43, -2,
+ -42, -3,
+ -40, -3,
+ -37, -5,
+ -36, -5,
+ -35, -7,
+ -35, -9,
+ -38, -12,
+ -39, -18,
+ -40, -20,
+ -42, -23,
+ -44, -23,
+ -48, -25,
+ -49, -28,
+ -54, -35,
+ -58, -34,
+ -57, -37,
+ -59, -38,
+ -62, -38,
+ -62, -41,
+ -65, -41,
+ -65, -42,
+ -63, -43,
+ -63, -42,
+ -68, -46,
+ -66, -47,
+ -68, -50,
+ -69, -51,
+ -68, -53,
+ -65, -55,
+ -70, -55,
+ -75, -53,
+ -76, -48,
+ -74, -42,
+ -75, -41,
+ -74, -40,
+ -73, -37,
+ -72, -33,
+ -72, -30,
+ -71, -23,
+ -70, -20,
+ -71, -18,
+ -75, -16,
+ -77, -14,
+ -77, -13,
+ -80, -7,
+ -82, -6,
+ -82, -4,
+ -80, -3,
+ -80, -2,
+ -81, -2,
+ -81, -1,
+ -80, 1,
+ -78, 3,
+ -77, 4,
+ -78, 6,
+ -79, 9,
+ -80, 9,
+ -80, 7,
+ -81, 7,
+ -86, 10,
+ -86, 11,
+ -88, 13,
+ -91, 14,
+ -94, 16,
+ -98, 16,
+ -102, 18,
+ -105, 20,
+ -106, 23,
+ -112, 29,
+ -113, 31,
+ -115, 32,
+ -115, 30,
+ -111, 26,
+ -110, 24,
+ -109, 23,
+ -110, 23,
+ -112, 25,
+ -112, 26,
+ -115, 28,
+ -114, 28,
+ -116, 30,
+ -118, 34,
+ -121, 35,
+ -122, 36,
+ -124, 39,
+ -124, 46,
+ -125, 48,
+ -123, 48,
+ -124, 50,
+ -128, 51,
+ -125, 49,
+ -124, 49,
+ -127, 52,
+ -131, 55,
+ -133, 54,
+ -131, 52,
+ -132, 54,
+ -134, 56,
+ -133, 57,
+ -134, 58,
+ -135, 56,
+ -138, 58,
+ -142, 60,
+ -144, 60,
+ -147, 61,
+ -148, 61,
+ -149, 60,
+ -152, 59,
+ -154, 58,
+ -153, 57,
+ -152, 58,
+ -152, 60,
+ -149, 62,
+ -153, 61,
+ -154, 59,
+ -155, 58,
+ -160, 56,
+ -165, 54,
+ -164, 55,
+ -160, 57,
+ -158, 58,
+ -157, 59,
+ -162, 59,
+ -162, 60,
+ -164, 60,
+ -165, 61,
+ -167, 61,
+ -166, 60,
+ -165, 61,
+ -166, 62,
+ -164, 63,
+ -161, 64,
+ -161, 65,
+ -165, 64,
+ -168, 66,
+ -164, 67,
+ -163, 67,
+ -166, 68,
+ -166, 69,
+ -164, 69,
+ -163, 70,
+ -156, 72,
+ -148, 71,
+ -142, 70,
+ -136, 69,
+ -131, 70,
+ -128, 71,
+ -122, 70,
+ -118, 69,
+ -114, 69,
+ -116, 68,
+ -110, 68,
+ -108, 66,
+ -107, 68,
+ -105, 69,
+ -98, 68,
+ -98, 70,
+ -96, 68,
+ -93, 69,
+ -97, 70,
+ -96, 74,
+ -91, 74,
+ -92, 73,
+ -93, 73,
+ -94, 72,
+ -90, 68,
+ -89, 69,
+ -87, 68,
+ -85, 70,
+ -82, 69,
+ -82, 66,
+ -83, 66,
+ -86, 66,
+ -88, 64,
+ -91, 63,
+ -94, 61,
+ -95, 59,
+ -94, 59,
+ -93, 57,
+ -90, 57,
+ -85, 55,
+ -82, 55,
+ -82, 53,
+ -80, 51,
+ -78, 52,
+ -80, 55,
+ -77, 56,
+ -77, 57,
+ -78, 59,
+ -77, 60,
+ -77, 62,
+ -74, 62,
+ -70, 61,
+ -69, 59,
+ -67, 58,
+ -65, 60,
+ -60, 55,
+ -56, 53,
+ -56, 52,
+ -59, 47,
+ -56, 47,
+ -56, 46,
+ -53, 46,
+ -54, 49,
+ -56, 50,
+ -55, 52,
+ -59, 51,
+ -60, 50,
+ -67, 50,
+ -71, 47,
+ -67, 49,
+ -65, 49,
+ -64, 48,
+ -66, 48,
+ -65, 47,
+ -61, 45,
+ -60, 46,
+ -61, 47,
+ -62, 45,
+ -65, 43,
+ -66, 44,
+ -63, 45,
+ -67, 45,
+ -70, 44,
+ -71, 43,
+ -70, 42,
+ -74, 41,
+ -72, 41,
+ -74, 40,
+ -76, 37,
+ -75, 35,
+ -78, 34,
+ -81, 32,
+ -81, 32,
+ -80, 27,
+ -81, 25,
+ -83, 28,
+ -83, 29,
+ -84, 30,
+ -90, 30,
+ -89, 29,
+ -94, 30,
+ -97, 28,
+ -97, 26,
+ 0, 0,
+ -76, 43,
+ -79, 43,
+ -82, 41,
+ -83, 42,
+ -81, 45,
+ -80, 45,
+ -81, 46,
+ -87, 46,
+ -88, 44,
+ -88, 42,
+ -86, 43,
+ -86, 45,
+ -85, 46,
+ -85, 48,
+ -86, 48,
+ -88, 49,
+ -92, 47,
+ -90, 47,
+ -88, 48,
+ -87, 47,
+ -85, 47,
+ -83, 45,
+ -84, 44,
+ -83, 44,
+ -82, 42,
+ -81, 43,
+ -80, 43,
+ -78, 44,
+ -76, 44,
+ -76, 43,
+ 0, 0,
+ -156, 20,
+ -155, 20,
+ -155, 19,
+ -156, 19,
+ -156, 21,
+ -158, 21,
+ -158, 22,
+ -156, 20,
+ 0, 0,
+ -159, 22,
+ -160, 22,
+ -160, 23,
+ -159, 22,
+ 0, 0,
+ -97, 26,
+ -98, 22,
+ -96, 19,
+ -94, 18,
+ -91, 19,
+ -90, 21,
+ -87, 22,
+ -89, 16,
+ -85, 16,
+ -83, 15,
+ -84, 11,
+ -82, 9,
+ -81, 9,
+ -79, 10,
+ -77, 8,
+ 0, 0,
+ -85, 22,
+ -83, 23,
+ -80, 23,
+ -74, 20,
+ -78, 20,
+ -77, 21,
+ -78, 21,
+ -80, 22,
+ -82, 22,
+ -82, 23,
+ -83, 22,
+ -85, 22,
+ 0, 0,
+ -78, 19,
+ -77, 19,
+ -76, 18,
+ -77, 18,
+ -78, 19,
+ 0, 0,
+ -73, 20,
+ -71, 20,
+ -68, 19,
+ -71, 19,
+ -71, 18,
+ -72, 18,
+ -74, 18,
+ -72, 19,
+ -73, 20,
+ 0, 0,
+ -67, 19,
+ -65, 19,
+ -66, 18,
+ -67, 18,
+ -67, 19,
+ 0, 0,
+ -64, 19,
+ -63, 18,
+ 0, 0,
+ -62, 17,
+ -61, 16,
+ 0, 0,
+ -61, 15,
+ -61, 14,
+ 0, 0,
+ -61, 13,
+ -62, 12,
+ 0, 0,
+ -78, 25,
+ -77, 24,
+ 0, 0,
+ 143, -11,
+ 144, -14,
+ 145, -15,
+ 147, -19,
+ 148, -20,
+ 153, -26,
+ 154, -28,
+ 153, -33,
+ 152, -34,
+ 150, -36,
+ 150, -37,
+ 149, -38,
+ 148, -38,
+ 146, -39,
+ 144, -38,
+ 143, -39,
+ 141, -38,
+ 139, -35,
+ 137, -36,
+ 139, -36,
+ 138, -34,
+ 138, -35,
+ 137, -35,
+ 138, -33,
+ 136, -35,
+ 134, -33,
+ 131, -32,
+ 124, -33,
+ 123, -34,
+ 120, -34,
+ 118, -35,
+ 116, -35,
+ 115, -34,
+ 116, -33,
+ 116, -32,
+ 115, -30,
+ 115, -29,
+ 113, -26,
+ 114, -27,
+ 113, -24,
+ 114, -22,
+ 119, -20,
+ 120, -20,
+ 122, -19,
+ 123, -16,
+ 124, -17,
+ 124, -16,
+ 125, -16,
+ 124, -15,
+ 127, -14,
+ 129, -15,
+ 131, -11,
+ 130, -11,
+ 130, -12,
+ 132, -13,
+ 133, -13,
+ 132, -11,
+ 133, -11,
+ 134, -12,
+ 135, -12,
+ 137, -11,
+ 137, -12,
+ 136, -13,
+ 137, -13,
+ 137, -14,
+ 136, -13,
+ 135, -15,
+ 138, -17,
+ 139, -16,
+ 139, -17,
+ 138, -17,
+ 140, -18,
+ 141, -17,
+ 142, -13,
+ 143, -11,
+ 0, 0,
+ 145, -40,
+ 146, -41,
+ 147, -41,
+ 147, -42,
+ 146, -43,
+ 145, -40,
+ 0, 0,
+ 178, -39,
+ 177, -39,
+ 177, -40,
+ 176, -41,
+ 175, -42,
+ 174, -41,
+ 172, -41,
+ 172, -42,
+ 168, -44,
+ 166, -46,
+ 168, -47,
+ 168, -48,
+ 167, -47,
+ 170, -47,
+ 172, -44,
+ 173, -44,
+ 174, -42,
+ 175, -41,
+ 175, -40,
+ 174, -39,
+ 175, -39,
+ 175, -38,
+ 174, -36,
+ 173, -35,
+ 174, -35,
+ 175, -37,
+ 176, -37,
+ 177, -38,
+ 178, -38,
+ 178, -39,
+ 0, 0,
+ 0, -70,
+ 8, -70,
+ 16, -70,
+ 24, -70,
+ 32, -69,
+ 40, -70,
+ 48, -68,
+ 53, -66,
+ 57, -67,
+ 60, -68,
+ 65, -68,
+ 70, -68,
+ 67, -70,
+ 72, -72,
+ 80, -68,
+ 83, -66,
+ 90, -67,
+ 95, -67,
+ 96, -65,
+ 99, -66,
+ 104, -65,
+ 109, -67,
+ 114, -66,
+ 114, -67,
+ 122, -67,
+ 130, -67,
+ 134, -67,
+ 135, -66,
+ 136, -67,
+ 146, -67,
+ 148, -68,
+ 154, -68,
+ 160, -70,
+ 168, -71,
+ 170, -72,
+ 162, -77,
+ 165, -78,
+ 160, -79,
+ 168, -82,
+ 167, -83,
+ 175, -84,
+ -177, -85,
+ -169, -85,
+ -161, -86,
+ -153, -86,
+ -145, -86,
+ -142, -86,
+ -150, -85,
+ -152, -82,
+ -146, -81,
+ -150, -80,
+ -150, -79,
+ -157, -77,
+ -150, -78,
+ -144, -76,
+ -147, -75,
+ -139, -74,
+ -131, -74,
+ -128, -74,
+ -128, -73,
+ -120, -74,
+ -112, -74,
+ -104, -75,
+ -104, -73,
+ -96, -74,
+ -88, -73,
+ -82, -74,
+ -76, -74,
+ -68, -72,
+ -70, -69,
+ -68, -67,
+ -60, -63,
+ -58, -62,
+ -64, -66,
+ -66, -68,
+ -63, -70,
+ -64, -74,
+ -70, -77,
+ -78, -75,
+ -84, -78,
+ -80, -80,
+ -72, -82,
+ -64, -83,
+ -58, -84,
+ -50, -83,
+ -42, -82,
+ -34, -80,
+ -32, -77,
+ -24, -76,
+ -16, -73,
+ -8, -71,
+ 0, -70,
+ 0, 0,
+ 0, 89,
+ 180, 89,
+ 0, 0,
+ 90, 89,
+ -90, 89,
+ 0, 0,
+ 0, -89,
+ 180, -89,
+ 0, 0,
+ 90, -89,
+ -90, -89,
+ 0, 0
+ );
+
+
+// #define NPOINTS (sizeof(globe_data)/sizeof(globe_data[0]))
+
+
diff --git a/examples/apps/globe/images.inc b/examples/apps/globe/images.inc
new file mode 100644
index 00000000..282a61c0
--- /dev/null
+++ b/examples/apps/globe/images.inc
@@ -0,0 +1,52 @@
+
+Const
+ usr_toggle_grid : 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,196, 14, 0, 0,196, 14, 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,192,113, 65,255, 0,255,255, 0,
+ 255,176,105, 65,255, 0,255,255, 0,255,160, 97, 49,255, 0,255,255,
+ 0,255,160, 89, 49,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,192,121, 81,255, 0,255,255, 0,255,176,105,
+ 65,255, 0,255,255, 0,255,160, 97, 49,255, 0,255,255, 0,255,160,
+ 89, 49,255, 0,255,255, 0,255,255, 0,255,255, 0,255,192,129, 81,
+ 192,129, 81,192,121, 81,192,121, 81,192,113, 65,176,113, 65,176,105,
+ 65,176,105, 49,176, 97, 49,176, 97, 49,160, 89, 49,160, 89, 49,160,
+ 89, 49,160, 89, 49,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 192,129, 81,255,255,255,255,255,255,192,113, 65,255,255,255,255,255,
+ 255,176,105, 65,255,255,255,255,255,255,160, 97, 49,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,192,129, 81,
+ 255,255,255,255,255,255,192,121, 65,255,255,255,255,255,255,176,105,
+ 65,255,255,255,255,255,255,176, 97, 49,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,208,144, 97,208,136, 97,208,136, 97,192,129, 81,
+ 192,129, 81,192,121, 81,192,121, 81,192,113, 65,176,105, 65,176,105,
+ 65,176,105, 49,176, 97, 49,176, 97, 49,160, 89, 49,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,208,136, 97,255,255,255,255,255,255,
+ 192,129, 81,255,255,255,255,255,255,192,113, 65,255,255,255,255,255,
+ 255,176,105, 65,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,208,144, 97,255,255,255,255,255,255,192,129, 81,
+ 255,255,255,255,255,255,192,121, 81,255,255,255,255,255,255,176,105,
+ 65,255, 0,255,255, 0,255,255, 0,255,255, 0,255,224,152,113,224,
+ 152,113,208,144, 97,208,144, 97,208,136, 97,208,136, 97,192,129, 81,
+ 192,129, 81,192,121, 81,192,121, 65,176,113, 65,176,113, 65,176,105,
+ 65,176,105, 65,255, 0,255,255, 0,255,255, 0,255,255, 0,255,224,
+ 152, 97,255,255,255,255,255,255,208,136, 97,255,255,255,255,255,255,
+ 192,129, 81,255,255,255,255,255,255,192,113, 65,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,224,152,113,255,
+ 255,255,255,255,255,208,144, 97,255,255,255,255,255,255,192,129, 81,
+ 255,255,255,255,255,255,192,121, 81,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,224,152,113,224,152,113,224,152,113,224,152,113,224,
+ 152, 97,208,144, 97,208,144, 97,208,136, 97,208,136, 97,208,129, 81,
+ 192,129, 81,192,121, 81,192,121, 81,176,113, 65,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,224,152,113,255, 0,255,255, 0,255,224,
+ 144, 97,255, 0,255,255, 0,255,208,136, 97,255, 0,255,255, 0,255,
+ 192,129, 81,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,224,152,113,255, 0,255,255, 0,255,224,152,113,255,
+ 0,255,255, 0,255,208,144, 97,255, 0,255,255, 0,255,208,129, 81,
+ 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/globe/images/toggle_grid.bmp b/examples/apps/globe/images/toggle_grid.bmp
new file mode 100644
index 00000000..47760e12
--- /dev/null
+++ b/examples/apps/globe/images/toggle_grid.bmp
Binary files differ
diff --git a/examples/apps/globe/units/placeholder.txt b/examples/apps/globe/units/placeholder.txt
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/examples/apps/globe/units/placeholder.txt