2007/5/8, Mattias Gaertner <[EMAIL PROTECTED]>:


I'm not sure. No other widget set supports forms with Ok buttons. Only
close buttons. That's why everyone puts an OK-TButton on every
dialog.


Right, in this case it is best to do all in wince interface and not pollute
the LCL with that.

How does the wince intf know, that the LCL form supports a Result
of mrOK?


Maybe testing fsModal in FormState.
In this case the button do nothing if the form is not modal, but generally
if you select a borderstyle of bsDialog this is for a modal form.
The only other solution to show this button on the top bar is to call the
SHDoneButton api, otherwise it show the X button that put the application in
the background without any message for us.

This give :
if (WindowInfo^.WinControl is TCustomForm) and
 (fsModal in TCustomForm(WindowInfo^.WinControl).FormState) then
   case lo(WParam) of
     IDOK: TCustomForm(WindowInfo^.WinControl).ModalResult:=mrOK;
   end;

Do this look right ?

The "case .." is because we can also trap an IDCANCEL message after changing
the OK button by a Cancel button with a SHDoneButton call but I still not
manage to find the right parameter for that.

Patrick

Reply via email to