On Wed, 9 May 2007 13:43:47 +0200
"Patrick Chevalley" <[EMAIL PROTECTED]> wrote:

> 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.

Common:

MessageDlg('Error','Description',mtError,[mbIgnore,mbCancel],0)

There should be no mrOk.


> 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 ?

Maybe instead a positive test is better:

  if (TheForm.DefaultControl is TCustomButton)
  and (TCustomButton(TheForm.DefaultControl).ModalResult=mrOk) then
    TheForm.DefaultControl.ExecuteDefaultAction;

Or, if the 'ok' button of the wince form is merely a 'default' button,
then

  if (TheForm.DefaultControl<>nil) then
    TheForm.DefaultControl.ExecuteDefaultAction;
 
> 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.


Mattias

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to