mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 13:59:31 +02:00
* adds some documentation to the TCustomCheckbox control.
* added an example file for TCustomCheckbox * Improves the formatting of the tarrayexample.pas file * adds some documentation to the TWinControl patch by Graeme git-svn-id: trunk@8984 -
This commit is contained in:
parent
66de59fb71
commit
e95350931d
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -745,6 +745,7 @@ docs/xml/lcl/propertystorage.xml svneol=LF#text/xml eol=lf
|
||||
docs/xml/lcl/spin.xml svneol=LF#text/xml eol=lf
|
||||
docs/xml/lcl/stdactns.xml svneol=LF#text/xml eol=lf
|
||||
docs/xml/lcl/stdctrls.xml svneol=LF#text/xml eol=lf
|
||||
docs/xml/lcl/stdctrls/tcustomcheckbox_allowgrayed.pas svneol=native#text/plain
|
||||
docs/xml/lcl/stringhashlist.xml svneol=LF#text/xml eol=lf
|
||||
docs/xml/lcl/textstrings.xml svneol=LF#text/xml eol=lf
|
||||
docs/xml/lcl/toolwin.xml svneol=LF#text/xml eol=lf
|
||||
|
@ -9841,9 +9841,10 @@
|
||||
</element>
|
||||
<!-- property Visibility: public -->
|
||||
<element name="TWinControl.TabStop">
|
||||
<short/>
|
||||
<descr/>
|
||||
<seealso/>
|
||||
<short>Determines if the user can tab to a control.</short>
|
||||
<descr>Use the TabStop to allow or disallow access to the control using the Tab key.
|
||||
|
||||
If the TabStop is True, the control is in the tab order. If TabStop is False, the control is not in the tab order and the user can't press the Tab key to move to the control.</descr>
|
||||
</element>
|
||||
<!-- property Visibility: public -->
|
||||
<element name="TWinControl.OnDockDrop">
|
||||
|
@ -6,68 +6,76 @@ uses
|
||||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Classes
|
||||
{ add your units here },strings,DynamicArray;
|
||||
Classes,
|
||||
strings,
|
||||
DynamicArray;
|
||||
|
||||
type
|
||||
Tarrayexampleclass=class
|
||||
private
|
||||
procedure doDestroyItem(Sender: Tobject; Col,Row: Integer;var Item: Pointer);
|
||||
TArrayExampleClass = class
|
||||
private
|
||||
procedure doDestroyItem(Sender: Tobject; Col,Row: Integer;var Item: Pointer);
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure Tarrayexampleclass.doDestroyItem(Sender: Tobject; Col,Row: Integer;
|
||||
procedure TArrayExampleClass.doDestroyItem(Sender: Tobject; Col,Row: Integer;
|
||||
var Item: Pointer);
|
||||
begin
|
||||
strdispose(Item);
|
||||
StrDispose(Item);
|
||||
end;
|
||||
|
||||
|
||||
var FCols: Tarray;
|
||||
var ex:Tarrayexampleclass;
|
||||
var
|
||||
FCols: Tarray;
|
||||
ex: TArrayExampleClass;
|
||||
|
||||
begin
|
||||
FCols:= TArray.Create;
|
||||
ex:= Tarrayexampleclass.Create;
|
||||
FCols.OnDestroyItem:=@ex.doDestroyItem;
|
||||
FCols.SetLength(8,8);
|
||||
//FCols.OnNewItem:=@doNewItem;
|
||||
FCols.arr[0,0]:=StrNew('string1');
|
||||
FCols.arr[4,7]:=StrNew('string2');
|
||||
FCols.arr[4,3]:=StrNew('string3');
|
||||
writeln('0,0:'+Pchar(FCols.arr[0,0]));
|
||||
writeln('4,7:'+Pchar(FCols.arr[4,7]));
|
||||
FCols.MoveColRow(true,4,5);
|
||||
writeln('after moving column 4 to 5');
|
||||
writeln('5,7:'+Pchar(FCols.arr[5,7]));
|
||||
writeln('before exchanging row 7 and 3:');
|
||||
writeln('5,3:'+Pchar(FCols.arr[5,3]));
|
||||
writeln('5,7:'+Pchar(FCols.arr[5,7]));
|
||||
FCols.ExchangeColRow(false,7,3);
|
||||
writeln('after exchanging row 7 and 3:');
|
||||
writeln('5,3:'+Pchar(FCols.arr[5,3]));
|
||||
writeln('5,7:'+Pchar(FCols.arr[5,7]));
|
||||
FCols.DeleteColRow(true,5);
|
||||
writeln('after deleting column 5:');
|
||||
try
|
||||
writeln('5,3:'+Pchar(FCols.arr[5,3])); //this raises an exception
|
||||
except
|
||||
writeln ('An exception has taken place be because 5,3 does not exist.');
|
||||
end;
|
||||
try
|
||||
writeln('5,7:'+Pchar(FCols.arr[5,7])); //this raises an exception
|
||||
except
|
||||
writeln ('An exception has taken place be because 5,7 does not exist.');
|
||||
end;
|
||||
FCols.Clear; writeln('after clear:');
|
||||
try
|
||||
writeln('4,7:'+Pchar(FCols.arr[4,7])); //this raises an exception
|
||||
except
|
||||
writeln ('An exception has taken place be because 4,7 does not exist.');
|
||||
end;
|
||||
FCols.Destroy;
|
||||
ex.Destroy;
|
||||
readln;
|
||||
FCols := TArray.Create;
|
||||
ex := TArrayExampleClass.Create;
|
||||
FCols.OnDestroyItem := @ex.doDestroyItem;
|
||||
|
||||
FCols.SetLength(8,8);
|
||||
FCols.arr[0,0] := StrNew('string1');
|
||||
FCols.arr[4,7] := StrNew('string2');
|
||||
FCols.arr[4,3] := StrNew('string3');
|
||||
|
||||
writeln('0,0:' + Pchar(FCols.arr[0,0]));
|
||||
writeln('4,7:' + Pchar(FCols.arr[4,7]));
|
||||
|
||||
FCols.MoveColRow(True,4,5);
|
||||
writeln('after moving column 4 to 5');
|
||||
writeln('5,7:' + Pchar(FCols.arr[5,7]));
|
||||
writeln('before exchanging row 7 and 3:');
|
||||
writeln('5,3:' + Pchar(FCols.arr[5,3]));
|
||||
writeln('5,7:' + Pchar(FCols.arr[5,7]));
|
||||
|
||||
FCols.ExchangeColRow(False,7,3);
|
||||
writeln('after exchanging row 7 and 3:');
|
||||
writeln('5,3:' + Pchar(FCols.arr[5,3]));
|
||||
writeln('5,7:' + Pchar(FCols.arr[5,7]));
|
||||
|
||||
FCols.DeleteColRow(true,5);
|
||||
writeln('after deleting column 5:');
|
||||
|
||||
try
|
||||
writeln('5,3:' + Pchar(FCols.arr[5,3])); //this raises an exception
|
||||
except
|
||||
writeln ('An exception has taken place be because 5,3 does not exist.');
|
||||
end;
|
||||
|
||||
try
|
||||
writeln('5,7:' + Pchar(FCols.arr[5,7])); //this raises an exception
|
||||
except
|
||||
writeln ('An exception has taken place be because 5,7 does not exist.');
|
||||
end;
|
||||
|
||||
FCols.Clear; writeln('after clear:');
|
||||
try
|
||||
writeln('4,7:' + Pchar(FCols.arr[4,7])); //this raises an exception
|
||||
except
|
||||
writeln ('An exception has taken place be because 4,7 does not exist.');
|
||||
end;
|
||||
|
||||
FCols.Destroy;
|
||||
ex.Destroy;
|
||||
readln;
|
||||
end.
|
||||
|
||||
|
||||
|
@ -4828,24 +4828,33 @@ Properties can include [Checked], [Click] (mouse clicks on button) and the actio
|
||||
<!-- enumeration type Visibility: default -->
|
||||
<element name="TCheckBoxState">
|
||||
<short>Check Box State</short>
|
||||
<descr>Check Box State: a set of constants defining the possible states of a Check Box - <br/>Checked, meaning it has been selected; <br/>Unchecked meaning irt has not been selected or has been deselected; <br/>Grayed meaning it has been rendered inoperative or unable to be selected and appears grey or faintly visible on the Form</descr>
|
||||
<descr>Check Box State: a set of constants defining the possible states of a Check Box - <br/>
|
||||
|
||||
Checked, meaning it has been selected; <br/>
|
||||
|
||||
Unchecked meaning irt has not been selected or has been deselected; <br/>
|
||||
|
||||
Grayed meaning it has been rendered inoperative or unable to be selected and appears grey or faintly visible on the Form</descr>
|
||||
</element>
|
||||
<!-- enumeration value Visibility: default -->
|
||||
<element name="TCheckBoxState.cbUnchecked">
|
||||
<short/>
|
||||
<descr>The check box has no check mark, indicating that the user has not selected the option.</descr>
|
||||
</element>
|
||||
<!-- enumeration value Visibility: default -->
|
||||
<element name="TCheckBoxState.cbChecked">
|
||||
<short/>
|
||||
<descr>The check box has a check mark in it, indicating that the user has selected the option.</descr>
|
||||
</element>
|
||||
<!-- enumeration value Visibility: default -->
|
||||
<element name="TCheckBoxState.cbGrayed">
|
||||
<short/>
|
||||
<descr>The check box has a check mark in it, but it is grayed.</descr>
|
||||
</element>
|
||||
<!-- object Visibility: default -->
|
||||
<element name="TCustomCheckBox">
|
||||
<short>Custom Check Box</short>
|
||||
<descr>Custom Check Box: the base class from which the Check Box is derived.</descr>
|
||||
<short>TCustomCheckBox is the ancestor of all check-box components.</short>
|
||||
<descr>Custom Check Box: The base (abstract) class from which the TCheckBox is derived. Check boxes present the user with options that can be selected (checked) or deselected (unchecked).</descr>
|
||||
<seealso>
|
||||
<link id="TCheckBox"/>
|
||||
</seealso>
|
||||
</element>
|
||||
<!-- variable Visibility: private -->
|
||||
<element name="TCustomCheckBox.FAllowGrayed">
|
||||
@ -4976,21 +4985,22 @@ Properties can include [Checked], [Click] (mouse clicks on button) and the actio
|
||||
</element>
|
||||
<!-- property Visibility: public -->
|
||||
<element name="TCustomCheckBox.AllowGrayed">
|
||||
<short/>
|
||||
<descr/>
|
||||
<seealso/>
|
||||
<short>Determines whether the check box can be in a "grayed" state.</short>
|
||||
<descr>If AllowGrayed is set to True, the check box has three possible states: checked, unchecked and grayed. If AllowGrayed is set to False, the check box has only two possible states: checked and unchecked.</descr>
|
||||
<example file="stdctrls/tcustomcheckbox_allowgrayed.pas"/>
|
||||
</element>
|
||||
<!-- property Visibility: public -->
|
||||
<element name="TCustomCheckBox.State">
|
||||
<short/>
|
||||
<descr/>
|
||||
<seealso/>
|
||||
<short>Indicates whether the check box is selected, deselected or grayed.</short>
|
||||
<descr>See TCheckBoxState for possible values of State.</descr>
|
||||
<example file="TCustomCheckbox_AllowGrayed.pas"/>
|
||||
</element>
|
||||
<!-- property Visibility: public -->
|
||||
<element name="TCustomCheckBox.TabStop">
|
||||
<short/>
|
||||
<descr/>
|
||||
<seealso/>
|
||||
<short>Determines if the user can tab to a control.</short>
|
||||
<descr>Use the TabStop to allow or disallow access to the control using the Tab key.
|
||||
|
||||
If the TabStop is True, the control is in the tab order. If TabStop is False, the control is not in the tab order and the user can't press the Tab key to move to the control.</descr>
|
||||
</element>
|
||||
<!-- property Visibility: public -->
|
||||
<element name="TCustomCheckBox.UseOnChange">
|
||||
|
6
docs/xml/lcl/stdctrls/tcustomcheckbox_allowgrayed.pas
Normal file
6
docs/xml/lcl/stdctrls/tcustomcheckbox_allowgrayed.pas
Normal file
@ -0,0 +1,6 @@
|
||||
{ This example uses a check box on a form. When the application runs, the check box is initially checked. When the user clicks it, the check box is unchecked. Clicking it again grays the check box. }
|
||||
procedure TForm1.FormCreate(Sender: TObject);
|
||||
begin
|
||||
Checkbox1.AllowGrayed := True;
|
||||
Checkbox1.State := cbChecked;
|
||||
end;
|
Loading…
Reference in New Issue
Block a user