Message dialog button position lazarus / 35-Windows CE ---------------------------------------------------------------------- Racing Dog · 2023-04-15 20:21 It seems that on WinCe message dialog buttons are in the normal position at the bottom of the dialog. So when I used Basic4PPC to ceate dialogs that was where they appeared (apart from just OK which appeared at the right end of the Title bar). But now I am using the latest stable versions of Lazarus and the arm- wince for Windows 32 bit, the dialog buttons appear above the text for OK, or the side for multiple buttons. Can I prevent this somehow? ---------------------------------------------------------------------- d2010 · 2025-09-06 20:56 You can reconstruct entire Dialog-Box. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function GetAveCharSize2(Canvas: TCanvas): TPoint;var  I: Integer;  Buffer: array[0..51] of Char;begin  for I := 0 to 25 do Buffer[I] := Chr(I + Ord('A'));  for I := 0 to 25 do Buffer[I + 26] := Chr(I + Ord('a'));  GetTextExtentPoint(Canvas.Handle, Buffer, 52, TSize(Result));  Result.X := Result.X div 52;end; Function dfn_dcl_button2(const titlu_cutie,                      APrompt:string;            mesajul_buton_yes:string;                    yeslatime:integer;{0.default/else.ok}             mesajul_buton_no:string;                     nolatime:integer;{0.default/else.ok}            latimea_ferestrei:integer;          inaltimea_ferestrei:integer): Char;var  msj_prompt:string;  de_sus_in_jos:integer;  pozitia_butoanelor    :integer;  s3m:string;  leny,lenn:integer;  latime_buton,ucsxdir,ucsydir:integer;     Form: TForm;  Prompt:array[1..15] of TLabel;  DialogUnits: TPoint;  ButtonTop, ButtonWidth, ButtonHeight: Integer;    Function creaza_okaiulul:integer;   begin      with TButton.Create(Form) do    begin        Parent := Form;        Caption :=mesajul_buton_yes;      ModalResult := mrOk;        Default := True;        SetBounds(MulDiv(pozitia_butoanelor, DialogUnits.X, 4),                ButtonTop,                  yeslatime,                  ButtonHeight);        result:=ButtonTop+ButtonHeight div 2;        pozitia_butoanelor:=pozitia_butoanelor+10+yeslatime;      end;    end;     procedure creaza_cancelurul;   begin      with TButton.Create(Form) do      begin        Parent := Form;        Caption := mesajul_buton_no;        ModalResult := mrCancel;        Cancel := True;        SetBounds(MulDiv(pozitia_butoanelor, DialogUnits.X, 4),                                                     ButtonTop,                                                      nolatime,                                                 ButtonHeight);        pozitia_butoanelor:=pozitia_butoanelor+10+nolatime;        ucsxdir:=Left;        ucsydir:=Top;      end;    end;     procedure creaza_promptolira;   var i,j:integer;q:pchar;   begin     s3m:=msj_prompt;     j:=15;     i:=01;     while (i>0) do      begin         q:=pchar(msj_prompt);         i:=pos(#10,msj_prompt);         if (i>0)           then begin s3m:=copy(msj_prompt,1,i-1);                    inc(q,i);                      msj_prompt:=strpas(q);                    i:=2;                 end           else s3m:=msj_prompt;           Prompt[j] := TLabel.Create(Form);          with Prompt[j] do                begin                      Parent := Form;                      AutoSize := True;                      Left := MulDiv(8, DialogUnits.X, 4);                      Top := MulDiv(de_sus_in_jos, DialogUnits.Y, 8);                      Caption := s3m;                 end;            dec(j);          if (j<2) then j:=1;          inc(de_sus_in_jos,12);          dec(i);          if (j<1) then i:=0;      end;{while}   end;    procedure pozitoneaza_butonasele;  begin         ButtonTop := MulDiv(de_sus_in_jos, DialogUnits.Y, 8);      ButtonHeight := MulDiv(14, DialogUnits.Y, 8);      inc(de_sus_in_jos,21);  end; begin   if  (length(mesajul_buton_yes)<2) then mesajul_buton_yes:='Yes';  if  (length(mesajul_buton_no)<2) then mesajul_buton_no:='No';  leny:=length(mesajul_buton_yes);  lenn:=length(mesajul_buton_no);   case inaltimea_ferestrei of   0..1: inaltimea_ferestrei:=200;   else  end; {case}    case latimea_ferestrei of   0..1: latimea_ferestrei:=164;   else  end; {case}   de_sus_in_jos     :=11;  msj_prompt        :=APrompt;  pozitia_butoanelor:=38;   if (length(msj_prompt)<2) then msj_prompt:='Prompt';  pozitia_butoanelor:= 38;  if (msj_prompt[1]='#') and ((msj_prompt[5] in ['1'..'F']))          then pozitia_butoanelor:=ord(msj_prompt[5]) - ord('0')*10;  result := 'e';  Form := TForm.Create(Application);  with Form do    try      Canvas.Font  := Font;      DialogUnits  := GetAveCharSize2(Canvas);    BorderStyle  := bsDialog;      Caption      := titlu_cutie;      ClientWidth  := MulDiv(latimea_ferestrei  , DialogUnits.X, 4);      ClientHeight := MulDiv(inaltimea_ferestrei,  DialogUnits.Y, 8);      Position     := poScreenCenter;       if (msj_prompt<>'none') then         creaza_promptolira;       pozitoneaza_butonasele;      if (yeslatime<1) then yeslatime:=60+leny;      yeslatime:=MulDiv(yeslatime, DialogUnits.X, 4);      if (nolatime<1) then nolatime:=60+lenn;      nolatime :=MulDiv(nolatime, DialogUnits.X, 4);      creaza_okaiulul;        SetCursorPos(Screen.width div 2,Screen.height div 2);//      SetCursorPos(100,300);      creaza_cancelurul;      result:='n';    if (ShowModal = mrOk) then result:='y';    finally      Form.Free;    end;end;  Demonstration-of -Call Code: [Select]            if (dfn_dcl_button2('Select precompilation type',simx                                 ,'da-&yes-ci ==covlxtxt',100,                                  'no-&nu-net ==topovlexc',0,400,110)='y')                        then maxibufe:=strcat(maxibufe,'#pragma hdrstop ("covlxtxt.pCh")'#13#10#13#10'')                else Begin kCLEANScreenState:='F';                                          maxibufe:=strcat(maxibufe,'#pragma hdrstop ("topovlex.pcH")'#13#10#13#10'');                      End; Code: Python  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  { Lnk= c:\vlaxcompil\SRCC2LSP\Delphi.3\Z-INCS\I2\dfn_dcl_button2.i2  ;Nam:w.msgbox_yesno2.i2 Aprompt:str=comenzi(1st char = '#'2.                 2th char = ordinea 1.prompt,edit,ok,cancel                              ordinea 2.edit,prompt,ok,cancel'o0.row_column)                order:int(0.row_column)                         (1.column_row)                       (2.boxed_row boxed_column)                       (3.boxed_column boxed_row)                         (4.boxed_row column)                         (5.row boxed_column)                       (6.boxed_column row)                         (7.column boxed_row)            order_question:int 2.upper ..6                  question:str(1.str si alignment for text)                is_default:int(0.no)(1.yes)                   yes_str:str(""."Yes")First char is alignment                yes_height:int(0.no)                 yes_width:int(0.no)                  no_str:str(""."No")First char is alignment                 no_height:int(0.no)}  //            if (dfn_dcl_button2('Select type of sort',simx //                                ,'da-&yes-ci ==topoLogical- sort',100, //                                 'no-&nu-net ==ascending- ascii',0,400,110)='y')