mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-26 07:48:16 +02:00
examples: fixed compilation after the removal of the clistbox unit from Maxim Ganetsky
git-svn-id: trunk@14235 -
This commit is contained in:
parent
48c44ddb94
commit
83ebfd0672
@ -26,7 +26,7 @@ unit bitbtnform;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, Forms, Buttons, cListbox, StdCtrls, Controls;
|
Classes, Forms, Buttons, StdCtrls, Controls;
|
||||||
|
|
||||||
type
|
type
|
||||||
TForm1 = class(TForm)
|
TForm1 = class(TForm)
|
||||||
|
@ -51,13 +51,6 @@
|
|||||||
<CodeGeneration>
|
<CodeGeneration>
|
||||||
<Generate Value="Faster"/>
|
<Generate Value="Faster"/>
|
||||||
</CodeGeneration>
|
</CodeGeneration>
|
||||||
<Linking>
|
|
||||||
<Options>
|
|
||||||
<Win32>
|
|
||||||
<GraphicApplication Value="True"/>
|
|
||||||
</Win32>
|
|
||||||
</Options>
|
|
||||||
</Linking>
|
|
||||||
<Other>
|
<Other>
|
||||||
<CompilerPath Value="$(CompPath)"/>
|
<CompilerPath Value="$(CompPath)"/>
|
||||||
</Other>
|
</Other>
|
||||||
|
@ -40,7 +40,7 @@ interface
|
|||||||
{$ASSERTIONS ON}
|
{$ASSERTIONS ON}
|
||||||
|
|
||||||
|
|
||||||
uses Classes, Forms, Buttons, StdCtrls, Controls, Menus, ExtCtrls, CListBox,
|
uses Classes, Forms, Buttons, StdCtrls, Controls, Menus, ExtCtrls,
|
||||||
ComCtrls, SysUtils, GraphType, Graphics, Dialogs, Inifiles, Spin, ClipBrd,
|
ComCtrls, SysUtils, GraphType, Graphics, Dialogs, Inifiles, Spin, ClipBrd,
|
||||||
LCLIntf, LResources;
|
LCLIntf, LResources;
|
||||||
|
|
||||||
@ -53,7 +53,6 @@ type
|
|||||||
Button1 : Array[0..15] of TButton;
|
Button1 : Array[0..15] of TButton;
|
||||||
CheckBox1 : Array[1..35] of TCheckBox;
|
CheckBox1 : Array[1..35] of TCheckBox;
|
||||||
//ClipBoard1 : TClipBoard;
|
//ClipBoard1 : TClipBoard;
|
||||||
CListBox1 : TClistBox;
|
|
||||||
ColorDialog1 : TColorDialog;
|
ColorDialog1 : TColorDialog;
|
||||||
ComboBox1 : TComboBox;
|
ComboBox1 : TComboBox;
|
||||||
//DirectoryListBox1 : TDirectoryListBox;
|
//DirectoryListBox1 : TDirectoryListBox;
|
||||||
@ -94,6 +93,7 @@ type
|
|||||||
PaintBox1 : TPaintBox;
|
PaintBox1 : TPaintBox;
|
||||||
Panel1 : TPanel;
|
Panel1 : TPanel;
|
||||||
PixMap1 : TPixMap;
|
PixMap1 : TPixMap;
|
||||||
|
png : TPortableNetworkGraphic;
|
||||||
PopupMenu1 : TPopupMenu;
|
PopupMenu1 : TPopupMenu;
|
||||||
Hello : TMenuItem;
|
Hello : TMenuItem;
|
||||||
Doctor : TMenuItem;
|
Doctor : TMenuItem;
|
||||||
@ -326,7 +326,7 @@ implementation
|
|||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
writeln ('TestAll Warning: resource "', ResourceName,'" not found!');
|
//debugln ('TestAll Warning: resource "', ResourceName,'" not found!');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$I testtools.inc}
|
{$I testtools.inc}
|
||||||
@ -549,10 +549,6 @@ begin
|
|||||||
TClip.Caption := 'TClipBoard';
|
TClip.Caption := 'TClipBoard';
|
||||||
TClip.OnClick := @ShowMessage1;
|
TClip.OnClick := @ShowMessage1;
|
||||||
|
|
||||||
TClis := TMenuItem.Create(Self);
|
|
||||||
TClis.Caption := 'TCListBox';
|
|
||||||
TClis.OnClick := @ShowMessage1;
|
|
||||||
|
|
||||||
TCol := TMenuItem.Create(Self);
|
TCol := TMenuItem.Create(Self);
|
||||||
TCol.Caption := 'TColorDialog';
|
TCol.Caption := 'TColorDialog';
|
||||||
TCol.OnClick := @ShowMessage1;
|
TCol.OnClick := @ShowMessage1;
|
||||||
@ -568,7 +564,6 @@ begin
|
|||||||
AC1.Add(TCan);
|
AC1.Add(TCan);
|
||||||
AC1.Add(TChe);
|
AC1.Add(TChe);
|
||||||
AC1.Add(TClip);
|
AC1.Add(TClip);
|
||||||
AC1.Add(TClis);
|
|
||||||
AC1.Add(TCol);
|
AC1.Add(TCol);
|
||||||
AC1.Add(TCom);
|
AC1.Add(TCom);
|
||||||
|
|
||||||
@ -920,14 +915,9 @@ Bevel1 := TBevel.Create(Self);
|
|||||||
Width := 100;
|
Width := 100;
|
||||||
end;
|
end;
|
||||||
//++++++++++++++++++++++++++++++++++ TBitBtn1 +++++++++++++++++++++++++++++++++++++++
|
//++++++++++++++++++++++++++++++++++ TBitBtn1 +++++++++++++++++++++++++++++++++++++++
|
||||||
S := TFileStream.Create('../images/mouse.xpm', fmOpenRead);
|
png := TPortableNetworkGraphic.Create;
|
||||||
try
|
png.LoadFromLazarusResource('topendialog');
|
||||||
Pixmap1 := TPixmap.Create;
|
|
||||||
Pixmap1.TransparentColor := clBtnFace;
|
|
||||||
Pixmap1.LoadFromStream(S);
|
|
||||||
finally
|
|
||||||
S.Free;
|
|
||||||
end;
|
|
||||||
BitBtn1 := TBitBtn.Create(Self);
|
BitBtn1 := TBitBtn.Create(Self);
|
||||||
With BitBtn1 do
|
With BitBtn1 do
|
||||||
begin
|
begin
|
||||||
@ -963,7 +953,7 @@ BitBtn1 := TBitBtn.Create(Self);
|
|||||||
Font.Pitch := fpDefault;
|
Font.Pitch := fpDefault;
|
||||||
Font.Size := 10;
|
Font.Size := 10;
|
||||||
Font.Style := BitBtn1.Font.Style+[fsBold];
|
Font.Style := BitBtn1.Font.Style+[fsBold];
|
||||||
Glyph := PixMap1;
|
Glyph := png;
|
||||||
//height := 28; Has to be set before Glyph
|
//height := 28; Has to be set before Glyph
|
||||||
//HelpContext := 0; Identifier not found
|
//HelpContext := 0; Identifier not found
|
||||||
Hint := 'Settings for BitBtn1 >>';
|
Hint := 'Settings for BitBtn1 >>';
|
||||||
@ -1183,26 +1173,7 @@ end;
|
|||||||
//+++++++++++++++++++++++++++++++++++++ Clipboard1 ++++++++++++++++++++++++++++++++++
|
//+++++++++++++++++++++++++++++++++++++ Clipboard1 ++++++++++++++++++++++++++++++++++
|
||||||
//ClipBoard1 := TClipBoard.Create; //BenchForm[7] Don´t know how to use !?!
|
//ClipBoard1 := TClipBoard.Create; //BenchForm[7] Don´t know how to use !?!
|
||||||
//+++++++++++++++++++++++++++++++++++++ CListBox1 +++++++++++++++++++++++++++++++++++
|
//+++++++++++++++++++++++++++++++++++++ CListBox1 +++++++++++++++++++++++++++++++++++
|
||||||
CListBox1 := TCListBox.Create(Self);
|
|
||||||
with CListBox1 do
|
|
||||||
begin
|
|
||||||
Parent := BenchForm[8];
|
|
||||||
OnClick := @EventOnClick;
|
|
||||||
OnMouseDown := @EventOnMouseDown;
|
|
||||||
OnMouseUp := @EventOnMouseUp;
|
|
||||||
OnMouseMove := @EventOnMouseMove;
|
|
||||||
Items.Add('Hello');
|
|
||||||
Items.Add('Doctor');
|
|
||||||
Items.Add('Name');
|
|
||||||
Items.Add('Yesterday');
|
|
||||||
Items.Add('Tomorrow');
|
|
||||||
Left := 10;
|
|
||||||
ListColumns := 1;
|
|
||||||
Top := 10;
|
|
||||||
Width := 150;
|
|
||||||
Height := 100;
|
|
||||||
Visible := True;
|
|
||||||
end;
|
|
||||||
//+++++++++++++++++++++++++++++++++++++ ColorDialog1 ++++++++++++++++++++++++++++++++
|
//+++++++++++++++++++++++++++++++++++++ ColorDialog1 ++++++++++++++++++++++++++++++++
|
||||||
ColorDialog1 := TColorDialog.Create(Self); //BenchForm[9]
|
ColorDialog1 := TColorDialog.Create(Self); //BenchForm[9]
|
||||||
//+++++++++++++++++++++++++++++++++++++ ComboBox1 +++++++++++++++++++++++++++++++++++
|
//+++++++++++++++++++++++++++++++++++++ ComboBox1 +++++++++++++++++++++++++++++++++++
|
||||||
@ -2266,12 +2237,8 @@ ScrollBar1 := TScrollBar.Create(Self);
|
|||||||
Visible := True;
|
Visible := True;
|
||||||
end;}
|
end;}
|
||||||
//++++++++++++++++++++++++++++++++++++ SpeedButton1..4 ++++++++++++++++++++++++++++++
|
//++++++++++++++++++++++++++++++++++++ SpeedButton1..4 ++++++++++++++++++++++++++++++
|
||||||
Pixmap1:=TPixMap.Create;
|
png := TPortableNetworkGraphic.Create;
|
||||||
Pixmap1.TransparentColor:=clBtnFace;
|
png.LoadFromLazarusResource('open');
|
||||||
if not LoadResource('btn_openfile',Pixmap1) then
|
|
||||||
begin
|
|
||||||
LoadResource('default',Pixmap1);
|
|
||||||
end;
|
|
||||||
|
|
||||||
SpeedButton1 := TSpeedButton.Create(Self);
|
SpeedButton1 := TSpeedButton.Create(Self);
|
||||||
With SpeedButton1 do
|
With SpeedButton1 do
|
||||||
@ -2289,14 +2256,12 @@ SpeedButton1 := TSpeedButton.Create(Self);
|
|||||||
Hint := 'SpeedButton1';
|
Hint := 'SpeedButton1';
|
||||||
Color := clBtnFace;
|
Color := clBtnFace;
|
||||||
ShowHint := True;
|
ShowHint := True;
|
||||||
Glyph := Pixmap1;
|
Glyph := png;
|
||||||
Visible := True;
|
Visible := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Pixmap1:=TPixMap.Create;
|
png := TPortableNetworkGraphic.Create;
|
||||||
Pixmap1.TransparentColor:=clBtnFace;
|
png.LoadFromLazarusResource('menu_save');
|
||||||
if not LoadResource('btn_save',Pixmap1)
|
|
||||||
then LoadResource('default',Pixmap1);
|
|
||||||
|
|
||||||
SpeedButton2 := TSpeedButton.Create(Self);
|
SpeedButton2 := TSpeedButton.Create(Self);
|
||||||
With SpeedButton2 do
|
With SpeedButton2 do
|
||||||
@ -2312,19 +2277,13 @@ SpeedButton2 := TSpeedButton.Create(Self);
|
|||||||
Hint := 'SpeedButton1';
|
Hint := 'SpeedButton1';
|
||||||
Color := clBtnFace;
|
Color := clBtnFace;
|
||||||
ShowHint := True;
|
ShowHint := True;
|
||||||
Glyph := Pixmap1;
|
Glyph := png;
|
||||||
Enabled := True;
|
Enabled := True;
|
||||||
Visible := True;
|
Visible := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
S := TFileStream.Create('../images/fonts.xpm', fmOpenRead);
|
png := TPortableNetworkGraphic.Create;
|
||||||
try
|
png.LoadFromLazarusResource('item_font');
|
||||||
Pixmap1 := TPixmap.Create;
|
|
||||||
Pixmap1.TransparentColor := clBtnFace;
|
|
||||||
Pixmap1.LoadFromStream(S);
|
|
||||||
finally
|
|
||||||
S.Free;
|
|
||||||
end;
|
|
||||||
|
|
||||||
SpeedButton3 := TSpeedButton.Create(Self);
|
SpeedButton3 := TSpeedButton.Create(Self);
|
||||||
With SpeedButton3 do
|
With SpeedButton3 do
|
||||||
@ -2340,19 +2299,13 @@ SpeedButton3 := TSpeedButton.Create(Self);
|
|||||||
Hint := 'SpeedButton1';
|
Hint := 'SpeedButton1';
|
||||||
Color := clBtnFace;
|
Color := clBtnFace;
|
||||||
ShowHint := True;
|
ShowHint := True;
|
||||||
Glyph := Pixmap1;
|
Glyph := png;
|
||||||
Enabled := True;
|
Enabled := True;
|
||||||
Visible := True;
|
Visible := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
S := TFileStream.Create('../images/color.xpm', fmOpenRead);
|
png := TPortableNetworkGraphic.Create;
|
||||||
try
|
png.LoadFromLazarusResource('tcolordialog');
|
||||||
Pixmap1 := TPixmap.Create;
|
|
||||||
Pixmap1.TransparentColor := clBtnFace;
|
|
||||||
Pixmap1.LoadFromStream(S);
|
|
||||||
finally
|
|
||||||
S.Free;
|
|
||||||
end;
|
|
||||||
|
|
||||||
SpeedButton4 := TSpeedButton.Create(Self);
|
SpeedButton4 := TSpeedButton.Create(Self);
|
||||||
With SpeedButton4 do
|
With SpeedButton4 do
|
||||||
@ -2368,10 +2321,11 @@ SpeedButton4 := TSpeedButton.Create(Self);
|
|||||||
Hint := 'SpeedButton4';
|
Hint := 'SpeedButton4';
|
||||||
Color := clBtnFace;
|
Color := clBtnFace;
|
||||||
ShowHint := True;
|
ShowHint := True;
|
||||||
Glyph := Pixmap1;
|
Glyph:=png;
|
||||||
Enabled := True;
|
Enabled := True;
|
||||||
Visible := True;
|
Visible := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//++++++++++++++++++++++++++++++++++++ SpinButton1 ++++++++++++++++++++++++++++++++++
|
//++++++++++++++++++++++++++++++++++++ SpinButton1 ++++++++++++++++++++++++++++++++++
|
||||||
|
|
||||||
//++++++++++++++++++++++++++++++++++++ SpinEdit1 ++++++++++++++++++++++++++++++++++++
|
//++++++++++++++++++++++++++++++++++++ SpinEdit1 ++++++++++++++++++++++++++++++++++++
|
||||||
|
Loading…
Reference in New Issue
Block a user