Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2007.07.15;
Скачать: CL | DM;

Вниз

TBAddInsButtons treat Separate as normal buttons   Найти похожие ветки 

 
azsd ©   (2006-12-05 11:26) [0]

I added an toolbar on form and assigned toolbarbuttons to action.
but when I add separator item, it just show as normal null button.

       for I:= 0 to High( Buttons ) do
       begin
         if Buttons[ I ] = nil then break;
         if Buttons[ I ] = PKOLChar( "-" ) then
         begin
           PAB.iBitmap := -1;
           //PAB.idCommand := 0;
           PAB.fsState := 0;
           PAB.fsStyle := TBSTYLE_SEP;
           PAB.iString := -1;
         end
         else
         begin
           Str := Buttons[ I ];
           ....
         end;
         ....
      end

I have set breakpoint on "if Buttons[ I ] = PKOLChar( "-" ) " in KOL.pas,
but It can"t stopped at the compare but run to "Str:=Buttons[I]" and I checked the Str value was "-";
I don"t know if it something wrong in compiler or kol because Debug Inspector always show I as 2 but I am sure only Buttons[6] is "-", other buttons[I] is just "";

KOL 2.48, Delphi 7.1 (SE), UNICODE_CTRLS.


 
azsd ©   (2006-12-05 11:48) [1]


if Buttons[ I ] = PKOLChar( "-" ) then

it Seems doing compare of two pointers address?
I modify it to "Buttons[I]^ = "-"" (or lstrcmp(uttons[ I ], PKOLChar( "-" ))) and it can "if" into "PAB.iBitmap := -1;" now.
mmmm, it now leave an blank there instead button but still not vert line stripe appearence.

I"ll check prev kol source later to see if there some differents.


 
azsd ©   (2006-12-05 12:23) [2]

er, I have remove tboFlat for debug and forget set it back now.
I have modified other codes in the function with same compare operations.
now it seems working fine.

I don"t know why compare between pkolchar not works as except,
but I think there will some same issue in code now.


 
Vladimir Kladov   (2006-12-05 19:15) [3]

certainly StrComp / WStrCmp should be there, I"ll fix it.


 
azsd ©   (2006-12-06 06:52) [4]

TControl.TBSetTooltips in KOL_asm.inc show only one char for unicode.
I added some define switch there then its working now.


procedure TControl.TBSetTooltips(BtnID1st: Integer;
 const Tooltips: array of PKOLChar);
asm
       PUSH     EBX
       PUSH     ESI
       MOV      ESI, ECX
       MOV      EBX, EAX
       PUSHAD
       MOV      ECX, [EBX].fTBttCmd
       INC      ECX
       LOOP     @@1
       CALL     NewList
       MOV      [EBX].fTBttCmd, EAX
       {$IFDEF USE_AUTOFREE4CONTROLS}
       XCHG     EDX, EAX
       MOV      EAX, EBX
       CALL     TControl.Add2AutoFree
       {$ENDIF}
       {$IFDEF UNICODE_CTRLS}
       CALL     NewWStrList
       {$ELSE}
       CALL     NewStrList
       {$ENDIF}
       MOV      [EBX].fTBttTxt, EAX
       {$IFDEF USE_AUTOFREE4CONTROLS}
       XCHG     EDX, EAX
       MOV      EAX, EBX
       CALL     TControl.Add2AutoFree
       {$ENDIF}
@@1:    POPAD
       MOV      ECX, [EBP+8]
       INC      ECX
       JZ       @@exit
@@loop:
       PUSH     ECX
       PUSH     EDX
       PUSH     0
       LODSD
       MOV      EDX, EAX
       MOV      EAX, ESP
       {$IFDEF UNICODE_CTRLS}
       CALL     System.@WStrFromPWChar
       {$ELSE}
       CALL     System.@LStrFromPChar
       {$ENDIF}

       MOV      EDX, [ESP+4]
       MOV      EAX, [EBX].fTBttCmd
       CALL     TList.IndexOf
       TEST     EAX, EAX
       JGE      @@2

       MOV      EDX, [ESP+4]
       MOV      EAX, [EBX].fTBttCmd
       CALL     TList.Add
       POP      EDX
       PUSH     EDX
       MOV      EAX, [EBX].fTBttTxt
       {$IFDEF UNICODE_CTRLS}
       CALL     TWStrList.Add
       {$ELSE}
       CALL     TStrList.Add
       {$ENDIF}
       JMP      @@3

@@2:
       MOV      EDX, EAX
       POP      ECX
       PUSH     ECX
       MOV      EAX, [EBX].fTBttTxt
       {$IFDEF UNICODE_CTRLS}
       CALL     TWStrList.Put
       {$ELSE}
       CALL     TStrList.Put
       {$ENDIF}
@@3:
       CALL     RemoveStr

       POP      EDX
       POP      ECX
       INC      EDX
       LOOP     @@loop
@@exit:
       POP      ESI
       POP      EBX
end;


And TBButtonsWidth in Form havent effect, tboTextBottom in option been ignored, seems these problems still exists in kol 2.48.
I"ll try to fix it later.


 
azsd ©   (2006-12-06 08:34) [5]


 if (tboTextRight in Options) or
     FixFlatXP and {(Align in [caLeft, caRight]) and} (tboFlat in Options) then
   S := "tboTextRight";
 if (tboTextBottom in Options) and (S = "") then
   S := S + ", tboTextBottom";


if there [tboTextBottom, tboFlat] FixFlatXP combine, the tboTextBottom will be ignored because the (S = "") been break in first fixflatxp operate.
the result pcode in MainUnt*_1.inc will overide to [tboTextRight, tboFlat, tboNoDivider] in NewTooBar call.
I have added "and not(tboTextBottom in Options)" in first line but I am not sure if its an problem or feather.

and

Perform( TB_SETBUTTONSIZE, 200, 0 );


would have no effect because the buttons is already added to toolbar before this message.

previous I added separate width attrib/R/Writer in TKOLToolbarButton because I have to set different width in design time until TBButtonWidth appeared in MCK.



Страницы: 1 вся ветка

Текущий архив: 2007.07.15;
Скачать: CL | DM;

Наверх




Память: 0.49 MB
Время: 0.016 c
2-1182360468
Ccill
2007-06-20 21:27
2007.07.15
Как загрузить html код (с определенного сайта) в tmemo?


15-1181579172
Тохер
2007-06-11 20:26
2007.07.15
Возможно ли определить четкость фото?


3-1176811978
Новичёк
2007-04-17 16:12
2007.07.15
Проблема с подключением к БД


2-1182531715
nord489
2007-06-22 21:01
2007.07.15
Копирование при помощи OpenDialog


6-1165849083
vagrand
2006-12-11 17:58
2007.07.15
WebBrowser через разные прокси серверы