Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "KOL";
Текущий архив: 2007.07.15;
Скачать: [xml.tar.bz2];

Вниз

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 вся ветка

Форум: "KOL";
Текущий архив: 2007.07.15;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.47 MB
Время: 0.054 c
15-1181601761
Kostafey
2007-06-12 02:42
2007.07.15
Вопрос к модераторам


15-1181765527
megajober3d
2007-06-14 00:12
2007.07.15
Как работать с idHTTP, кто знает, кто здесь самый крутой :)!!!


2-1182178435
golikov
2007-06-18 18:53
2007.07.15
из Access в Excel.


2-1182154444
kyro
2007-06-18 12:14
2007.07.15
Вопрос по рендому


6-1163079942
untermensch
2006-11-09 16:45
2007.07.15
Как получить IP клиента в терминальном режиме ?





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский