From 9618584757f21e6d52319f8ad9f1263a85237df9 Mon Sep 17 00:00:00 2001 From: paul Date: Wed, 2 Dec 2009 02:30:44 +0000 Subject: [PATCH] ide: fix component treeview images git-svn-id: trunk@22914 - --- ideintf/componenttreeview.pas | 23 +++-- images/componenttreeview.lrs | 95 +++++++++++---------- images/componenttreeview/oi_collection.png | Bin 317 -> 394 bytes images/componenttreeview/oi_item.png | Bin 294 -> 346 bytes 4 files changed, 66 insertions(+), 52 deletions(-) diff --git a/ideintf/componenttreeview.pas b/ideintf/componenttreeview.pas index 7f525cd35d..9b2fafa804 100644 --- a/ideintf/componenttreeview.pas +++ b/ideintf/componenttreeview.pas @@ -45,7 +45,7 @@ type procedure SetSelection(const NewSelection: TPersistentSelectionList); protected procedure DoSelectionChanged; override; - function GetImageFor(AComponent: TComponent):integer; + function GetImageFor(APersistent: TPersistent):integer; procedure DragOver(Source: TObject; X,Y: Integer; State: TDragState; var Accept: Boolean); override; procedure DragCanceled; override; @@ -187,7 +187,7 @@ var begin CollectionNode := FTreeView.Items.AddChild(FNode, AName); CollectionNode.Data := ACollection; - CollectionNode.ImageIndex := 4; + CollectionNode.ImageIndex := FTreeView.GetImageFor(ACollection); CollectionNode.SelectedIndex := CollectionNode.ImageIndex; CollectionNode.MultiSelected := FTreeView.Selection.IndexOf(ACollection) >= 0; @@ -196,7 +196,7 @@ begin Item := ACollection.Items[i]; ItemNode := FTreeView.Items.AddChild(CollectionNode, Format('%d - %s', [i, Item.ClassName])); ItemNode.Data := Item; - ItemNode.ImageIndex := 5; + ItemNode.ImageIndex := FTreeView.GetImageFor(Item); ItemNode.SelectedIndex := ItemNode.ImageIndex; ItemNode.MultiSelected := FTreeView.Selection.IndexOf(Item) >= 0; end; @@ -420,17 +420,24 @@ begin end; end; -function TComponentTreeView.GetImageFor(AComponent: TComponent): integer; +function TComponentTreeView.GetImageFor(APersistent: TPersistent): integer; begin - if Assigned(AComponent) then + if Assigned(APersistent) then begin - if (AComponent is TControl) and (csAcceptsControls in TControl(AComponent).ControlStyle) then + if (APersistent is TControl) and (csAcceptsControls in TControl(APersistent).ControlStyle) then Result := 3 else - if (AComponent is TControl) then + if (APersistent is TControl) then Result := 2 else - Result := 1; + if (APersistent is TComponent) then + Result := 1 + else + if (APersistent is TCollection) then + Result := 4 + else + if (APersistent is TCollectionItem) then + Result := 5; end else Result := -1; diff --git a/images/componenttreeview.lrs b/images/componenttreeview.lrs index 94f5a29e0a..8532fd040a 100644 --- a/images/componenttreeview.lrs +++ b/images/componenttreeview.lrs @@ -33,18 +33,18 @@ LazarusResources.Add('oi_comp','PNG',[ +#145'k'#242#214'H'#193'.'#176'c'#203'vLi!'#12#1#128'F'#226#236#26#194#28#24 +'$i'#181#178'e'#129' C'#167#172'##'#29#138'='#3#251#248#203'm'#145'hE$M:'#23 +#206#3#2#157#166#160#20'Z'#235#236'2@'#236'u'#240'T'#164'?sv'#221'=q'#250'lA' - +#26#194#160#152'/Q'#237#31'b'#239#224'>'#26'c'#187#185'f'#196#172#206'|J0' - +#21#211')`'#152'6q'#24#226#174#173#178'P'#220#192#217#7#158#17#241'@'#237#162 - +#27#234#134#20'B'#146'$q'#246#255#156#149#163'48'#200''''#7'J'#188#191#253' ' - +#215'C'#151'[_L'#227'u[4M8Wy'#140'sC'#227'l'#172#214'('#228'-'#154']s'#196 - +#148#169#208'+'#221'?'#133#210#10#165#18'B'#21'g'#249'_'#17'}'#236'='#250#6 - +#23#230'o'#208'l'#133'T+}'#20#1#174#175#240#211#226'M'#130'0'#198#176#243'B' - +#230#218#197'G'#166'g?_'#190'4'#137#182#191#134'%-L'#195'FJA)'#159#163#186 - +'c+'#15#213#182#210'j{,'#253#222#198#11#227'lY'#154#6'R'#130'y'#250#165'3' - +#151#131' '#232#159'x'#247#196#225'o:sg'#172#178',j'#157'"'#144'$*%R)N'#222 - +'b'#219#150'2'#151#191'kb'#10#177#158#20'i'#10#255'*'#211#139'o'#29#219#140 - +#192']n?'#234'='#254#240'N'#161#17#164'J'#17#196')'#179'?'#254#129'e'#25'h' - +#157#210's#|'#215#211'wl'#227#209#201'w'#14#244#180#243#145#178'7'#221'3\' + +#26#194#160#152'/Q'#237#31'b'#239#224'>'#26'c'#187#185'f'#196#172#206'|J0' + +#127#21#211')`'#152'6q'#24#226#174#173#178'P'#220#192#217#7#158#17#241'@'#237 + +#162#27#234#134#20'B'#146'$q'#246#255#156#149#163'48'#200''''#7'J'#188#191 + +#253' '#215'C'#151'[_L'#227'u[4M8Wy'#140'sC'#227'l'#172#214'('#228'-'#154']s' + +#196#148#169#208'+'#221'?'#133#210#10#165#18'B'#21'g'#249'_'#17'}'#236'='#250 + +#6#23#230'o'#208'l'#133'T+}'#20#1#174#175#240#211#226'M'#130'0'#198#176#243 + +'B'#230#218#197'G'#166'g?_'#190'4'#127#137#182#191#134'%-L'#195'FJA)'#159#163 + +#186'c+'#15#213#182#210'j{,'#253#222#198#11#227'lY'#154#6'R'#130'y'#250#165 + +'3'#151#131' '#232#159'x'#247#196#225'o:sg'#172#178',j'#157'"'#144'$*%R)N' + +#222'b'#219#150'2'#151#191'kb'#10#177#158#20'i'#10#255'*'#211#139'o'#29#219 + +#140#192']n?'#234'='#254#240'N'#161#17#164'J'#17#196')'#179'?'#254#129'e'#25 + +'h'#157#210's#|'#215#211'wl'#227#209#201'w'#14#244#180#243#145#178'7'#221'3\' +#237#163#228#216#204'-'#172#224#135#17#221#182#135#147#182'W'#139'"'#24#207 +'2'#190#147'|'#223#23#207'O'#190'w'#228#169#137')'#247#201#215#207#235#177 +#147#31#235''''#234'S'#222#161'W'#222'~y'#221#243'7\dh'#252#142#16#161'x'#0#0 @@ -66,10 +66,10 @@ LazarusResources.Add('oi_control','PNG',[ +#7#223#167#6#169#31'9'#186#6#2#255'%Pr'#202'PW'#226#229#202'M'#128#5#215#0 +#171#9'B='#20#243#209'(A='#181#4'#n'#2#172'$p'#24#251'/'#193#147#241'\'#255 +#249'J'#231#212#239#176#3#215'@pT'#195'T'#140#132'/`m'#231#18'ji'#180'_'#135 - +'`['#23#245#11'D M'#167#243#31#250#7#137'oY'#5'2'#240':L'#172#26#248'V'#238 - +#238#29#222'jC'#200'9='#13'WDI'#198#136#180'Dj'#177'xe'#177'T'#13#1'F'#6'>' - +#253'N'#142#199'?7'#188#206'o'#161#243#174#205#182#241#161's'#0#0#0#0'IEND' - +#174'B`'#130 + +'`['#23#245#11'D M'#167#243#31#250#7#137'oY'#5'2'#240':L'#172#26#248'V'#127 + +#238#238#29#222'jC'#200'9='#13'WDI'#198#136#180'Dj'#177'xe'#177'T'#13#1'F'#6 + +'>'#253'N'#142#199'?7'#188#206'o'#161#243#174#205#182#241#161's'#0#0#0#0'IEN' + +'D'#174'B`'#130 ]); LazarusResources.Add('oi_form','PNG',[ #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#16#0#0#0#16#8#6#0#0#0#31#243#255'a' @@ -85,36 +85,43 @@ LazarusResources.Add('oi_form','PNG',[ +#209#13#198#150#207'P0'#183#253#0'a'#157'1'#148'('#18#213#200#172#170'F'#22 +#242#189#130#178#209#165'S'#20'$'#182'r'#186#1'E'#137'fU5'#178#244#177#144 +#238#140','#158#160' '#190'y'#143#13'8'#215'l'#144'('#18#135'64'#26'J'#30#163 - +'`z'#227'N7`H-q~'#31'K5rg q'#136#130#169#244'-'#134'%'#141'2'#197#154#146 - +#244#199#15'P0'#153#186#249#215''#16#157#205'j'#129#14'=P'#11'|'#233#253#203 - +#171#220'['#160#139#187#11#195#184#193'\rIJ'#129#176'D'#238'b1'#181'X2'#147 - +#151#209#215#217'~'#29#27#142't7'#189#206#223'{'#156#170#227#249':'#145#136#0 - +#0#0#0'IEND'#174'B`'#130 + +'`z'#227'N7`H-q~'#31'K5rg q'#136#130#169#244'-'#134#127'%'#141'2'#197#154#146 + +#244#199#15'P0'#153#186#249#215#127#16#157#205'j'#129#14'=P'#11'|'#233#253 + +#203#171#220'['#160#139#187#11#195#184#193'\rIJ'#129#176'D'#238'b1'#181'X2' + +#147#151#209#215#217'~'#29#27#142't7'#189#206#223'{'#156#170#227#249':'#145 + +#136#0#0#0#0'IEND'#174'B`'#130 ]); LazarusResources.Add('oi_collection','PNG',[ - #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#16#0#0#0#16#8#4#0#0#0#181#250'7' - +#234#0#0#0#4'gAMA'#0#0#175#200'7'#5#138#233#0#0#0#25'tEXtSoftware'#0'Adobe I' - +'mageReadyq'#201'e<'#0#0#0#207'IDAT('#207'u'#145'M'#10#194'0'#16'FG='#135'R' - +#207'P'#218#30#195'3'#184#243':E'#23#30#193'#'#184'q'#163#208#222#192'C("' - +#180#218#159#180#240'9'#153#180'i'#10#149#15#134#132'y'#188'0'#25#162#21#5#20 - +#218'x4'#7#185'!'#10'T'#221'B'#167'A'#137'}LkZ'#140#129#176#229#198#29#23#156 - +#145#226#138#221#137'6'#174'G'#128#10'7(L{'#4'P'#12#252#243#8#208' '#193#216 - +#163'o'#135'X#'#29#144'b'#240#228'x'#227#193#167#2'G'#141#12'@'#239')'#144 - +#225#217'yxp'#23'0'#181#194#151#145#151'X,'#144'X'#192' '#133'<4i0H'#205#200 - +#167#3'<.'#17'm{'#143#137'b'#164'4'#0'O:'#227'a"'#215#160#207'JF'#22'@'#254 - +#203'zt'#179#143#3#12#30'7uN'#254'x'#181#158#179'x'#29#159#150'?,?X'#234#201 - +'.Yw'#0#0#0#0'IEND'#174'B`'#130 + #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#16#0#0#0#16#8#6#0#0#0#31#243#255'a' + +#0#0#1'QIDATx^'#149#144'1K'#195'P'#16#199#255'/'#13#201'X'#200'P7'#233#236 + +#146#201#228'K'#248')B'#135#14'I'#190#134'c'#197#169'Cp'#140#248'!2'#20'\$K]' + +#179'D]'#130#29#10#1#167#180'1'#222#129'7<}'#161'z'#240#231#142#199#221#255 + +#253#238#20#128's'#210#25'I'#225'w'#236'Ho'#195'0|b$x'#232#178#235#186'G'#203 + +#178#28'y'#164#1#28#143'GdYv'#155'$'#201#205#183'I?f'#16'P'#243#211#225'p@]' + +#215'h'#154#6'\O'#167'S'#206#200#243#252'a'#189'^'#223#3'x'#22#26#163#1#9'eY' + +'"'#12'C'#16#13#254'J#'#157'<$'#153#9'PU'#21'6'#155#13#138#162#192'v'#187#133 + +#239#251#233'r'#185#188#6'p'#165#148#154#147','#141#128#127'b'#130' '#8'`' + +#162#17#9'M'#28#199'+'#166#177#181'}'#148'2'#210#240#16#139'k'#207#243#16'EQ' + +'j'#219'6'#136'h%'#246#248'i4'#153'L'#180#154'%'#31'8'#142#131#197'b'#145#2 + +#152'i'#6'&'#26#30'd'#18#206#174#235#162'm['#236#247'{H'#200#10'r'#241#147'4' + +',^G'#194't'#131'Q'#19#161#146','#6';:H'#200#239#164#11'r'#191'3'#208#240#144 + +#24#233#6#212#248'B'#15#175#220'c'#164'1'#223'E_a'#160#224'D'#13#239'''h'#196 + +#196'|'#131#255#208#244'}'#255#193'I'#137#187#1'w'#14'`'#134#241#232'I'#187 + +'/7Z'#188'~F'#2'd'#254#0#0#0#0'IEND'#174'B`'#130 ]); LazarusResources.Add('oi_item','PNG',[ - #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#16#0#0#0#16#8#4#0#0#0#181#250'7' - +#234#0#0#0#4'gAMA'#0#0#175#200'7'#5#138#233#0#0#0#25'tEXtSoftware'#0'Adobe I' - +'mageReadyq'#201'e<'#0#0#0#184'IDAT('#207'u'#145'['#14#194' '#16'E'#167#174 - +#195'&'#238#129#134'}'#154#232#135#27#212#248#138#181'O('#212#235'@_'#214#150 - +#156#225#135'9a.'#25#2#209#150#4#201'?v'#180#1'9\'#9#149#154#214'bB'#225#176 - +#31#20'W'#210#180#5'J'#207#27'/\Y'#185#224#216'+D'#17'I'#139#26#154'O'#141#28 - +')n,T(pbe'#20#180#167#230'F'#134#251'8'#138#179'D'#189'`'#252#133#225#233'n' - +#204#131'_9'#207#133#129'N'#201'8'#201's]'#232#148#138#179'd!'#193#162#225'4' - +#21#19#20#140#15#172#214#4#227'i'#24#21#22#154#145#192'/&~'#133#207'Fkop z$*qFvK)D&0UVD2kTe z25_a6nv*PzfPZ3wAP8Wh5eZEk$1A3>wSAN_((n+AYtQo#MNw+oHi&2?_V{TunM|~r zB_BABgT-Qz0&|#Y1|}LFWD?G<>!NL2?Du;}$O>}tlQb+|N5XW2Q4^t(ECxF|NXYM` z3v$0R(D0BL=?2vJLJzOpW27eSaefwW^{L9 za%BKPWN%_+AW3auXJt}lVPtu6$z?nM007TPL_t(2&vlVa3c@fDMn^q|QqNG@9>X)Z z^EyQr9>F8Haih@Qz(Xh^wA!Dv@Hv^ZX$qAOhJ<;%Fd3p11%DLUcr*vOAqrI8LZ?BA zeN1awjDfJ_#vK=&k>ZNoi8iiBfC@J#OnU@S4E*y5&>+Fsqi=^;BOQ=p@Z@;o!KVU8 zjSN8VDUjjWd3bOaFtx&$k(XF3kXXPVg*-HAFi6eFrvp4L5p8>qiDINQ08cvOVItR{ z&q_uXK>o{mbSATp0}LKFbx!_xwVtzh9iNszEI(N4$u3!U00000NkvXXu0mjf8a;YF diff --git a/images/componenttreeview/oi_item.png b/images/componenttreeview/oi_item.png index 8b8b1ca0000bc8fa8d0379926736029f8fabe364..27d18bb31065eb12018545ea118576c25331ed93 100644 GIT binary patch delta 330 zcmV-Q0k!_70@?zQ8Gi-<001BJ|6u?C0U=35K~#8NjgdiWhA~gQqYCh>#l+#h^?ZDofrPVASL+VkxY{JIgIK!4pK@z6VVgO{px)ipxjE zIs;rtc7htgaU5wF2I{(wq#{``Q0`q=*2WkBPk?{~#LohgzXp&HIft_}mJ1L$)N37} zRk;VmT8lCO2t$ML_3HpXFswpB0D6|MLt*OzEX_vH8e@L_MOg0b53fdc@SP;d`_;d4 c4|gd30H8CCI{0y0RR91007*qoM6N<$f?dRw9{>OV delta 278 zcmV+x0qOqQ0;U3x8Gi%-006c6H|hWY00d`2O+f$vugEtAis=9V02y>eSaefwW^{L9 za%BKPWN%_+AW3auXJt}lVPtu6$z?nM006j2L_t(2&vlVo4#FT1MW?RAChmcTeVXWp z8`SuUwNEJ2>p)-DmYm^-Ibkjt0@0QP$v<|q0XbX=m73OKLVw|~9~4*8v;|7f8!ud0 zx!~9;puM7gI_t%g@I1VILUKe z=#+}HWFf(#;WQN!6pRn7)&%2e7!?+pk-#q|eud9GMNdnz+eM;F+b-KWC(#KpC5v@C c1jV2)GNoJat`B*(PXGV_07*qoM6N<$g8O@Na{vGU