mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-02 16:39:56 +01:00
+ Added TCheckListBox component
git-svn-id: trunk@2643 -
This commit is contained in:
parent
0b6ddbf1c8
commit
93a4ed8800
3
.gitattributes
vendored
3
.gitattributes
vendored
@ -288,6 +288,8 @@ images/components/tcalendar.xpm -text svneol=native#image/x-xpixmap
|
||||
images/components/tcheckbox.ico -text svneol=unset#image/x-icon
|
||||
images/components/tcheckbox.xpm -text svneol=native#image/x-xpixmap
|
||||
images/components/tcheckgroup.xpm -text svneol=native#image/x-xpixmap
|
||||
images/components/tchecklistbox.ico -text svneol=unset#image/x-icon
|
||||
images/components/tchecklistbox.xpm -text svneol=native#image/x-xpixmap
|
||||
images/components/tcolordialog.ico -text svneol=unset#image/x-icon
|
||||
images/components/tcolordialog.xpm -text svneol=native#image/x-xpixmap
|
||||
images/components/tcombobox.ico -text svneol=unset#image/x-icon
|
||||
@ -493,6 +495,7 @@ lcl/arrow.pp svneol=native#text/pascal
|
||||
lcl/avglvltree.pas svneol=native#text/pascal
|
||||
lcl/buttons.pp svneol=native#text/pascal
|
||||
lcl/calendar.pp svneol=native#text/pascal
|
||||
lcl/checklst.pas svneol=native#text/pascal
|
||||
lcl/clipbrd.pp svneol=native#text/pascal
|
||||
lcl/clistbox.pp svneol=native#text/pascal
|
||||
lcl/comctrls.pp svneol=native#text/pascal
|
||||
|
||||
BIN
images/components/tchecklistbox.ico
Normal file
BIN
images/components/tchecklistbox.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
260
images/components/tchecklistbox.xpm
Normal file
260
images/components/tchecklistbox.xpm
Normal file
@ -0,0 +1,260 @@
|
||||
/* XPM */
|
||||
static char * tchecklistbox_xpm[] = {
|
||||
"20 19 238 2",
|
||||
" c None",
|
||||
". c #79797B",
|
||||
"+ c #818085",
|
||||
"@ c #7A797F",
|
||||
"# c #848388",
|
||||
"$ c #848587",
|
||||
"% c #808183",
|
||||
"& c #7C7C84",
|
||||
"* c #7D7D89",
|
||||
"= c #898795",
|
||||
"- c #7A7987",
|
||||
"; c #7A7A86",
|
||||
"> c #82828A",
|
||||
", c #828284",
|
||||
"' c #858583",
|
||||
") c #040500",
|
||||
"! c #000100",
|
||||
"~ c #090907",
|
||||
"{ c #000002",
|
||||
"] c #000005",
|
||||
"^ c #0A0911",
|
||||
"/ c #908F94",
|
||||
"( c #FDFCFF",
|
||||
"_ c #7A79A1",
|
||||
": c #FEFEFF",
|
||||
"< c #FBFDFF",
|
||||
"[ c #F2F6FF",
|
||||
"} c #FCFDFF",
|
||||
"| c #FCFCFF",
|
||||
"1 c #F5F5FF",
|
||||
"2 c #FEFBFF",
|
||||
"3 c #FEFCFF",
|
||||
"4 c #FCFBFF",
|
||||
"5 c #F8F7FD",
|
||||
"6 c #FFFFFF",
|
||||
"7 c #FDFEF8",
|
||||
"8 c #FFFFFD",
|
||||
"9 c #C3C2C8",
|
||||
"0 c #7A7981",
|
||||
"a c #4D4C4E",
|
||||
"b c #0F1231",
|
||||
"c c #05052B",
|
||||
"d c #0D0C34",
|
||||
"e c #0E0D37",
|
||||
"f c #08062E",
|
||||
"g c #0F0E2E",
|
||||
"h c #080820",
|
||||
"i c #F5F6FA",
|
||||
"j c #050503",
|
||||
"k c #FFFFFA",
|
||||
"l c #7C7B77",
|
||||
"m c #878586",
|
||||
"n c #BEBCC1",
|
||||
"o c #020005",
|
||||
"p c #817F8A",
|
||||
"q c #FFFDFF",
|
||||
"r c #F5F3FF",
|
||||
"s c #F9FBFF",
|
||||
"t c #F5F7FF",
|
||||
"u c #F2F3FF",
|
||||
"v c #F9F8FF",
|
||||
"w c #F4F3FF",
|
||||
"x c #FBF8FF",
|
||||
"y c #FBFAFF",
|
||||
"z c #000000",
|
||||
"A c #050400",
|
||||
"B c #060503",
|
||||
"C c #BBB9BC",
|
||||
"D c #010002",
|
||||
"E c #83818E",
|
||||
"F c #FCF9FF",
|
||||
"G c #030444",
|
||||
"H c #151659",
|
||||
"I c #000043",
|
||||
"J c #131258",
|
||||
"K c #040243",
|
||||
"L c #030037",
|
||||
"M c #F9F9FF",
|
||||
"N c #FAFAFF",
|
||||
"O c #020202",
|
||||
"P c #C1C2BC",
|
||||
"Q c #C9C8C3",
|
||||
"R c #B7B6B2",
|
||||
"S c #C2C0C1",
|
||||
"T c #060405",
|
||||
"U c #82828C",
|
||||
"V c #FBFBFF",
|
||||
"W c #EEF0FF",
|
||||
"X c #F5F8FF",
|
||||
"Y c #F7F6FF",
|
||||
"Z c #F3F3FF",
|
||||
"` c #F8F7FF",
|
||||
" . c #F9F7FF",
|
||||
".. c #F6F4FF",
|
||||
"+. c #FCFFFF",
|
||||
"@. c #010100",
|
||||
"#. c #010000",
|
||||
"$. c #7E8387",
|
||||
"%. c #02064F",
|
||||
"&. c #020650",
|
||||
"*. c #05084F",
|
||||
"=. c #040847",
|
||||
"-. c #050646",
|
||||
";. c #040349",
|
||||
">. c #0C0C42",
|
||||
",. c #FBFEFF",
|
||||
"'. c #000207",
|
||||
"). c #FEFFFF",
|
||||
"!. c #BEC0BB",
|
||||
"~. c #FFFFF8",
|
||||
"{. c #BDBEB8",
|
||||
"]. c #858994",
|
||||
"^. c #F8FCFF",
|
||||
"/. c #F7F9FF",
|
||||
"(. c #F3F5FF",
|
||||
"_. c #F2F4FF",
|
||||
":. c #F4F6FF",
|
||||
"<. c #F7F7FF",
|
||||
"[. c #F8F5FF",
|
||||
"}. c #F1F3FF",
|
||||
"|. c #FBFFFF",
|
||||
"1. c #00000B",
|
||||
"2. c #B9BCC5",
|
||||
"3. c #BABCB7",
|
||||
"4. c #FFFFFB",
|
||||
"5. c #777992",
|
||||
"6. c #F6F8FF",
|
||||
"7. c #C25A6D",
|
||||
"8. c #AB172F",
|
||||
"9. c #030416",
|
||||
"0. c #B7B8BD",
|
||||
"a. c #FDFEFF",
|
||||
"b. c #C0C0C0",
|
||||
"c. c #010101",
|
||||
"d. c #7D7DA1",
|
||||
"e. c #C194AF",
|
||||
"f. c #000019",
|
||||
"g. c #C9CCD5",
|
||||
"h. c #F4F4FE",
|
||||
"i. c #C8C8D0",
|
||||
"j. c #FFFEFF",
|
||||
"k. c #C390AA",
|
||||
"l. c #494B4E",
|
||||
"m. c #F5F9FF",
|
||||
"n. c #E7E7FF",
|
||||
"o. c #F7F4FF",
|
||||
"p. c #F8F1FF",
|
||||
"q. c #F8F2FF",
|
||||
"r. c #F0ECFF",
|
||||
"s. c #F9F6FF",
|
||||
"t. c #000023",
|
||||
"u. c #FBFCFF",
|
||||
"v. c #C2C1D1",
|
||||
"w. c #C5C4CC",
|
||||
"x. c #030207",
|
||||
"y. c #6D6B92",
|
||||
"z. c #00001E",
|
||||
"A. c #BABCC9",
|
||||
"B. c #C0C1C6",
|
||||
"C. c #000004",
|
||||
"D. c #8A8AA4",
|
||||
"E. c #C35B6D",
|
||||
"F. c #FAF8FF",
|
||||
"G. c #02020C",
|
||||
"H. c #FAFCF9",
|
||||
"I. c #C2C3BB",
|
||||
"J. c #F9FAF2",
|
||||
"K. c #BBBBB9",
|
||||
"L. c #070709",
|
||||
"M. c #818090",
|
||||
"N. c #F8F8FF",
|
||||
"O. c #F2F1FF",
|
||||
"P. c #FAFDFF",
|
||||
"Q. c #030500",
|
||||
"R. c #000200",
|
||||
"S. c #060702",
|
||||
"T. c #7E7F84",
|
||||
"U. c #F8F9FF",
|
||||
"V. c #080743",
|
||||
"W. c #141154",
|
||||
"X. c #050245",
|
||||
"Y. c #090540",
|
||||
"Z. c #100B4D",
|
||||
"`. c #09063B",
|
||||
" + c #F9FAFF",
|
||||
".+ c #01010B",
|
||||
"++ c #FEFFFA",
|
||||
"@+ c #FCFDF5",
|
||||
"#+ c #BBBCB7",
|
||||
"$+ c #7C7D7F",
|
||||
"%+ c #F4F1FF",
|
||||
"&+ c #F2EFFF",
|
||||
"*+ c #FBF7FF",
|
||||
"=+ c #F8F4FF",
|
||||
"-+ c #F2EDFF",
|
||||
";+ c #FBF9FF",
|
||||
">+ c #FCFEFF",
|
||||
",+ c #F3F8F4",
|
||||
"'+ c #070705",
|
||||
")+ c #C5C5C3",
|
||||
"!+ c #797A7C",
|
||||
"~+ c #4B4B4E",
|
||||
"{+ c #010051",
|
||||
"]+ c #160F5C",
|
||||
"^+ c #00003A",
|
||||
"/+ c #100C47",
|
||||
"(+ c #110E43",
|
||||
"_+ c #0C0938",
|
||||
":+ c #F9FCF5",
|
||||
"<+ c #FEFFEF",
|
||||
"[+ c #000300",
|
||||
"}+ c #7E7D83",
|
||||
"|+ c #C4C3C9",
|
||||
"1+ c #86858A",
|
||||
"2+ c #F2ECFF",
|
||||
"3+ c #FBF5FF",
|
||||
"4+ c #F4F2FF",
|
||||
"5+ c #F0EFFF",
|
||||
"6+ c #FEFFF6",
|
||||
"7+ c #F6FBE5",
|
||||
"8+ c #080C00",
|
||||
"9+ c #BBBEB5",
|
||||
"0+ c #C7C6CC",
|
||||
"a+ c #BBB9C6",
|
||||
"b+ c #C1BFCA",
|
||||
"c+ c #05040C",
|
||||
"d+ c #7D7C82",
|
||||
"e+ c #000007",
|
||||
"f+ c #070614",
|
||||
"g+ c #00000F",
|
||||
"h+ c #00020F",
|
||||
"i+ c #00000C",
|
||||
"j+ c #040519",
|
||||
"k+ c #000014",
|
||||
"l+ c #060513",
|
||||
"m+ c #070904",
|
||||
"n+ c #000009",
|
||||
"o+ c #00000E",
|
||||
". + @ # $ % & * = - ; > , ' ) ! ~ { ] ^ ",
|
||||
"/ ( _ : < [ } | 1 2 3 4 5 6 ! 7 8 : 9 ] ",
|
||||
"0 _ a _ 6 b c d e f g h : i j k l m n o ",
|
||||
"p q _ r s t u v w x y 4 4 : z 7 A B C D ",
|
||||
"E _ F _ 6 G H I J K L y M N O P Q R S T ",
|
||||
"U v _ V W X W Y Z ` ...s +.{ @.! A #.z ",
|
||||
"$._ 6 _ 6 %.&.*.=.-.;.>.,.+.'.).!.~.{.z ",
|
||||
"].^._ /.(._.:.:._.<.[.<.}.|.1.2.).3.4.j ",
|
||||
"5.6.7.8.8.8.8.8.8.8.8.Y x V 9.+.0.a.b.c.",
|
||||
"d.8.e.8.8.8.8.8.8.8.8.8.8.8.f.g.h.i.j.{ ",
|
||||
"_ k.l.k.8.m.n.o.p.q.r.s.8.8.t.u.v.V w.x.",
|
||||
"y.8.k.8.8.8.8.8.8.8.8.8.8.8.z.A.: B.4 C.",
|
||||
"D.V E.8.8.8.8.8.8.8.8.M F.| G.H.I.J.K.L.",
|
||||
"M.Z _ y (.N.` O.v <. .V } P.{ ! Q.R.S.z ",
|
||||
"T._ U._ 6 V.W.X.Y.Y.Z.`. ++..+).++@+#+j ",
|
||||
"$+: _ | x %+&+ .*+=+-+;+>+,+] ).z '+)+z ",
|
||||
"!+_ ~+_ 6 {+]+^+/+(+_+| :+<+[+:+, }+|+C.",
|
||||
"1+: _ 2 2+3+[.;+4+5+4 :.6+7+8+9+0+a+b+c+",
|
||||
"d+e+1.f+g+h+1.i+j+k+l+e+! m+! '+n+o+o+n+"};
|
||||
68
lcl/checklst.pas
Normal file
68
lcl/checklst.pas
Normal file
@ -0,0 +1,68 @@
|
||||
unit CheckLst;
|
||||
|
||||
{$mode objfpc} {$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, StdCtrls, Graphics, GraphType, Controls, VCLGlobals;
|
||||
|
||||
|
||||
type
|
||||
{ TCheckListBox }
|
||||
|
||||
TCheckListBox = class(TCustomListBox)
|
||||
private
|
||||
protected
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
published
|
||||
property Align;
|
||||
property Anchors;
|
||||
property BorderStyle;
|
||||
property ExtendedSelect;
|
||||
property Items;
|
||||
property ItemHeight;
|
||||
property MultiSelect;
|
||||
property OnClick;
|
||||
property OnDblClick;
|
||||
property OnDrawItem;
|
||||
property OnEnter;
|
||||
property OnExit;
|
||||
property OnKeyPress;
|
||||
property OnKeyDown;
|
||||
property OnKeyUp;
|
||||
property OnMouseMove;
|
||||
property OnMouseDown;
|
||||
property OnMouseUp;
|
||||
property OnResize;
|
||||
property ParentShowHint;
|
||||
property ShowHint;
|
||||
property Sorted;
|
||||
property Style;
|
||||
property TabOrder;
|
||||
property TabStop;
|
||||
property TopIndex;
|
||||
property Visible;
|
||||
end;
|
||||
|
||||
|
||||
procedure Register;
|
||||
|
||||
implementation
|
||||
|
||||
procedure Register;
|
||||
begin
|
||||
RegisterComponents('Additional',[TCheckListBox]);
|
||||
end;
|
||||
|
||||
{ TCheckListBox }
|
||||
|
||||
constructor TCheckListBox.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
FCompStyle := csCheckListBox;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -1644,7 +1644,7 @@ begin
|
||||
if not (Sender is TWinControl) then exit;
|
||||
case TWinControl(Sender).fCompStyle of
|
||||
|
||||
csListBox:
|
||||
csListBox, csCheckListBox:
|
||||
begin
|
||||
AWidget:=PGtkWidget(TWinControl(Sender).Handle);
|
||||
ListWidget:=PGtkList(GetWidgetInfo(AWidget, True)^.ImplementationWidget);
|
||||
@ -1687,7 +1687,7 @@ begin
|
||||
Y:=PInteger(PointerToY)^;
|
||||
case TWinControl(Sender).fCompStyle of
|
||||
|
||||
csListBox:
|
||||
csListBox, csCheckListBox:
|
||||
begin
|
||||
AWidget:=PGtkWidget(TWinControl(Sender).Handle);
|
||||
ListWidget:=PGtkList(GetWidgetInfo(AWidget, True)^.ImplementationWidget);
|
||||
@ -2275,11 +2275,11 @@ begin
|
||||
Result := integer(Data);
|
||||
end;
|
||||
|
||||
csListBox :
|
||||
csCheckListBox, csListBox:
|
||||
begin
|
||||
Widget:= GetWidgetInfo(Pointer(Handle), True)^.ImplementationWidget;
|
||||
Data:= TGtkListStringList.Create(PGtkList(Widget),
|
||||
TWinControl(Sender));
|
||||
TWinControl(Sender), TControl(Sender).fCompStyle = csCheckListBox);
|
||||
Result:= Integer(Data);
|
||||
end;
|
||||
else
|
||||
@ -2298,7 +2298,7 @@ begin
|
||||
csComboBox:
|
||||
Result:=GetComboBoxItemIndex(TComboBox(Sender));
|
||||
|
||||
csListBox:
|
||||
csListBox, csCheckListBox:
|
||||
begin
|
||||
if Handle<>0 then begin
|
||||
Widget:=nil;
|
||||
@ -2346,7 +2346,7 @@ begin
|
||||
csComboBox:
|
||||
SetComboBoxItemIndex(TComboBox(Sender),Integer(Data));
|
||||
|
||||
csListBox:
|
||||
csListBox, csCheckListBox:
|
||||
begin
|
||||
if Integer(Data)>=0 then
|
||||
gtk_list_select_item(
|
||||
@ -2468,7 +2468,7 @@ begin
|
||||
LM_GETSELCOUNT :
|
||||
begin
|
||||
case (Sender as TControl).fCompStyle of
|
||||
csListBox :
|
||||
csListBox, csCheckListBox :
|
||||
Result:=g_list_length(PGtkList(GetWidgetInfo(Pointer(Handle),
|
||||
True)^.ImplementationWidget)^.selection);
|
||||
csCListBox:
|
||||
@ -2479,7 +2479,7 @@ begin
|
||||
|
||||
LM_GETSEL :
|
||||
case (Sender as TControl).fCompStyle of
|
||||
csListBox:
|
||||
csListBox, csCheckListBox:
|
||||
begin
|
||||
{ Get the child in question of that index }
|
||||
Widget:=GetWidgetInfo(Pointer(Handle),True)^.ImplementationWidget;
|
||||
@ -2519,7 +2519,8 @@ begin
|
||||
begin
|
||||
case TControl(Sender).fCompStyle of
|
||||
csComboBox,
|
||||
csListBox : TGtkListStringList(TLMSort(Data^).List).Sorted:=
|
||||
csListBox,
|
||||
csCheckListBox : TGtkListStringList(TLMSort(Data^).List).Sorted:=
|
||||
TLMSort(Data^).IsSorted;
|
||||
csCListBox : TGtkCListStringList(TLMSort(Data^).List).Sorted :=
|
||||
TLMSort(Data^).IsSorted;
|
||||
@ -2530,10 +2531,10 @@ begin
|
||||
LM_SETSEL:
|
||||
begin
|
||||
if (Sender is TControl)
|
||||
and (TControl(Sender).fCompStyle in [csListBox, csCListBox])
|
||||
and (TControl(Sender).fCompStyle in [csListBox, csCheckListBox, csCListBox])
|
||||
and assigned (data) then
|
||||
begin
|
||||
if (TControl(Sender).fCompStyle = csListBox) then
|
||||
if (TControl(Sender).fCompStyle in [csListBox, csCheckListBox]) then
|
||||
begin
|
||||
if TLMSetSel(Data^).Selected then begin
|
||||
gtk_list_select_item(
|
||||
@ -2561,7 +2562,7 @@ begin
|
||||
LM_SETSELMODE :
|
||||
begin
|
||||
if (Sender is TControl) and
|
||||
(TControl(Sender).fCompStyle in [csListBox, csCListBox]) and
|
||||
(TControl(Sender).fCompStyle in [csListBox, csCheckListBox, csCListBox]) and
|
||||
assigned (data) then
|
||||
begin
|
||||
if TLMSetSelMode(Data^).MultiSelect then
|
||||
@ -2573,7 +2574,7 @@ begin
|
||||
else
|
||||
SelectionMode:= GTK_SELECTION_BROWSE;
|
||||
case TControl(Sender).fCompStyle of
|
||||
csListBox : gtk_list_set_selection_mode(PGtkList(
|
||||
csListBox, csCheckListBox : gtk_list_set_selection_mode(PGtkList(
|
||||
GetWidgetInfo(Pointer(Handle), True)^.ImplementationWidget), SelectionMode);
|
||||
csCListBox : gtk_clist_set_selection_mode(PGtkCList(
|
||||
GetWidgetInfo(Pointer(Handle), True)^.ImplementationWidget),SelectionMode);
|
||||
@ -2587,7 +2588,7 @@ begin
|
||||
begin
|
||||
if (Sender is TControl) then
|
||||
begin
|
||||
if (TControl(Sender).fCompStyle = csListBox) then
|
||||
if (TControl(Sender).fCompStyle in [csListBox, csCheckListBox]) then
|
||||
begin
|
||||
{ In TempWidget, a viewport is stored }
|
||||
Widget:= PGtkWidget(PGtkBin(Handle)^.child);
|
||||
@ -4375,7 +4376,7 @@ begin
|
||||
gtk_combo_set_case_sensitive(Widget, 1);
|
||||
|
||||
// Items
|
||||
ItemList:= TGtkListStringList.Create(PGtkList(Widget^.List),ComboBox);
|
||||
ItemList:= TGtkListStringList.Create(PGtkList(Widget^.List),ComboBox,False);
|
||||
gtk_object_set_data(PGtkObject(Widget), 'LCLList', ItemList);
|
||||
ItemList.Assign(ComboBox.Items);
|
||||
ItemList.Sorted:= ComboBox.Sorted;
|
||||
@ -4834,7 +4835,7 @@ begin
|
||||
SetupProps:= true;
|
||||
end;
|
||||
|
||||
csListBox :
|
||||
csListBox, csCheckListBox:
|
||||
begin
|
||||
p:= gtk_scrolled_window_new(nil, nil);
|
||||
GTK_WIDGET_UNSET_FLAGS(PGtkScrolledWindow(p)^.hscrollbar, GTK_CAN_FOCUS);
|
||||
@ -7352,6 +7353,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.377 2003/06/20 01:37:47 marc
|
||||
+ Added TCheckListBox component
|
||||
|
||||
Revision 1.376 2003/06/13 10:09:04 mattias
|
||||
fixed Set/GetPixel
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user