examples: fix checkbox example

git-svn-id: trunk@29135 -
This commit is contained in:
paul 2011-01-20 09:27:16 +00:00
parent 49445bf7fd
commit 6d649ede3b
2 changed files with 32 additions and 12 deletions

View File

@ -1,17 +1,19 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<CONFIG> <CONFIG>
<ProjectOptions> <ProjectOptions>
<Version Value="9"/>
<PathDelim Value="\"/> <PathDelim Value="\"/>
<Version Value="5"/>
<General> <General>
<Flags> <Flags>
<SaveOnlyProjectUnits Value="True"/> <SaveOnlyProjectUnits Value="True"/>
<LRSInOutputDirectory Value="False"/>
</Flags> </Flags>
<MainUnit Value="0"/> <MainUnit Value="0"/>
<IconPath Value="./"/> <ActiveWindowIndexAtStart Value="0"/>
<TargetFileExt Value=""/>
<ActiveEditorIndexAtStart Value="0"/>
</General> </General>
<BuildModes Count="1">
<Item1 Name="default" Default="True"/>
</BuildModes>
<PublishOptions> <PublishOptions>
<Version Value="2"/> <Version Value="2"/>
<DestinationDirectory Value="$(TestDir)\publishedproject\"/> <DestinationDirectory Value="$(TestDir)\publishedproject\"/>
@ -35,20 +37,28 @@
<Filename Value="checkbox.pp"/> <Filename Value="checkbox.pp"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="CheckBox"/> <UnitName Value="CheckBox"/>
<CursorPos X="19" Y="30"/> <IsVisibleTab Value="True"/>
<TopLine Value="1"/>
<EditorIndex Value="0"/> <EditorIndex Value="0"/>
<WindowIndex Value="0"/>
<TopLine Value="226"/>
<CursorPos X="20" Y="243"/>
<UsageCount Value="20"/> <UsageCount Value="20"/>
<Bookmarks Count="1">
<Item0 X="4" Y="245" ID="1"/>
</Bookmarks>
<Loaded Value="True"/> <Loaded Value="True"/>
<LoadedDesigner Value="True"/>
</Unit0> </Unit0>
</Units> </Units>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>
<Version Value="5"/> <Version Value="9"/>
<PathDelim Value="\"/> <PathDelim Value="\"/>
<CodeGeneration> <Parsing>
<Generate Value="Faster"/> <SyntaxOptions>
</CodeGeneration> <UseAnsiStrings Value="False"/>
</SyntaxOptions>
</Parsing>
<Linking> <Linking>
<Options> <Options>
<Win32> <Win32>

View File

@ -32,6 +32,8 @@
program CheckBox; program CheckBox;
{$mode objfpc}{$H+} {$mode objfpc}{$H+}
// program uses WriteLn
{$apptype console}
uses uses
Interfaces, Classes, Stdctrls, Forms, Buttons, Menus, Comctrls, Interfaces, Classes, Stdctrls, Forms, Buttons, Menus, Comctrls,
@ -166,7 +168,8 @@ End;
{------------------------------------------------------------------------------} {------------------------------------------------------------------------------}
procedure TForm1.LoadMainMenu; procedure TForm1.LoadMainMenu;
var
BtnGlyph: TPortableNetworkGraphic;
begin begin
OnDestroy := @FormKill; OnDestroy := @FormKill;
@ -234,7 +237,14 @@ begin
Button11.Width:= 45; Button11.Width:= 45;
Button11.Height:= 55; Button11.Height:= 55;
Button11.Flat:= true; Button11.Flat:= true;
Button11.Glyph.LoadFromFile('../images/btn_newform.xpm'); BtnGlyph := TPortableNetworkGraphic.Create;
try
BtnGlyph.LoadFromFile('../images/items/item_form.png');
Button11.Glyph.Assign(BtnGlyph);
finally
BtnGlyph.Free;
end;
// Button11.Spacing:= -1; // Button11.Spacing:= -1;
// Button11.Margin:= 4; // Button11.Margin:= 4;
Button11.Visible:= true; Button11.Visible:= true;