Fox message / input box positioning

View: New views
3 Messages — Rating Filter:   Alert me  

Fox message / input box positioning

by Alex Martin-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello, 

I do this: 

FXint response; 
response = FX::FXMessageBox::question(this, MBOX_OK_CANCEL, "Warning!","Press ok or cancel!"); 

and the message box pops up in the middle of my app. 

But if I do this: 

FXString input; 
FX::FXInputDialog::getString(input, this, "Enter Job Number", "Enter Job #",0); 

The input dialog pops up where the mouse pointer is. 

How do I direct this behavior? 

Thanks, 
Alex Martin

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users

Re: Fox message / input box positioning

by Jeroen van der Zijp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wednesday 16 September 2009, Alex Martin wrote:

> Hello,
>
> I do this:
>
> FXint response;
> response = FX::FXMessageBox::question(this, MBOX_OK_CANCEL,
> "Warning!","Press ok or cancel!");
>
> and the message box pops up in the middle of my app.
>
> But if I do this:
>
> FXString input;
> FX::FXInputDialog::getString(input, this, "Enter Job Number", "Enter Job
> #",0);
>
> The input dialog pops up where the mouse pointer is.
>
> How do I direct this behavior?


The problem was the PLACEMENT_OWNER option wasn't passed to execute() in the FXInputDialog::getString()
implementation.  This is now fixed in the code.

For now, you can either live with it, or substitute the convenience function with the following:

  FXInputDialog inputdialog(this,"Enter Job Number","Enter Job#",NULL,INPUTDIALOG_STRING,0,0,0,0);
  inputdialog.setText(result);
  if(inputdialog.execute(PLACEMENT_OWNER)){ // <<< PLACEMENT_OWNER causes the dialog to popup centered on its owner
    result=inputdialog.getText();
    return true;
    }


Hope this helps,

                        - Jeroen


P.S. The FOX website should be back on-line some-time next week, hopefully!

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users

Parent Message unknown Re: Fox message / input box positioning

by Jeroen van der Zijp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thursday 17 September 2009, Alex Martin wrote:

> On Thu, Sep 17, 2009 at 8:13 AM, Jeroen van der Zijp <jeroen@...
> > wrote:
>
> > On Wednesday 16 September 2009, Alex Martin wrote:
> > > Hello,
> > >
> > > I do this:
> > >
> > > FXint response;
> > > response = FX::FXMessageBox::question(this, MBOX_OK_CANCEL,
> > > "Warning!","Press ok or cancel!");
> > >
> > > and the message box pops up in the middle of my app.
> > >
> > > But if I do this:
> > >
> > > FXString input;
> > > FX::FXInputDialog::getString(input, this, "Enter Job Number", "Enter Job
> > > #",0);
> > >
> > > The input dialog pops up where the mouse pointer is.
> > >
> > > How do I direct this behavior?
> >
> >
> > The problem was the PLACEMENT_OWNER option wasn't passed to execute() in
> > the FXInputDialog::getString()
> > implementation.  This is now fixed in the code.
> >
> > For now, you can either live with it, or substitute the convenience
> > function with the following:
> >
> >  FXInputDialog inputdialog(this,"Enter Job Number","Enter
> > Job#",NULL,INPUTDIALOG_STRING,0,0,0,0);
> >  inputdialog.setText(result);
> >  if(inputdialog.execute(PLACEMENT_OWNER)){             // <<<
> > PLACEMENT_OWNER causes the dialog to popup centered on its owner
> >    result=inputdialog.getText();
> >    return true;
> >    }
> >
> >
> > Hope this helps,
> >
> >                        - Jeroen
> >
> >
> > P.S. The FOX website should be back on-line some-time next week, hopefully!
> >
>
> Thanks, that fixes my placement.
>
> I am looking forward to getting the website back up!

Yes, so do I.  Spent the entire weekend crimping cable connectors
in my new basement (GigE lan throughout the house).  

Now just waiting for the cable co. to hook me up...


> I am pretty good about reading the source these days though...
>
> However, how do I tell if the cancel button is pressed?
>
> FXFileDialog getSaveFilename(this,"Save",0,0,0,500,300);
> getSaveFilename.setDirectory(".\\");
> getSaveFilename.setFilename(filenametimestamp.text());
> getSaveFilename.setPatternList(".asc Files (*.asc)\nAll Files(*.*)");
> getSaveFilename.execute(PLACEMENT_OWNER);
> filename = getSaveFilename.getFilename();
>
> // unlike FXMessageBox, do I need to capture the SEL_CANCEL message to self?

The FXDialogBox::execute() returns the code passed along in stopModal().  The default
handler for cancel/escape returns false.

 FXFileDialog getSaveFilename(this,"Save",0,0,0,500,300);
 getSaveFilename.setDirectory(".\\");
 getSaveFilename.setFilename(filenametimestamp.text());
 getSaveFilename.setPatternList(".asc Files (*.asc)\nAll Files(*.*)");
 if(getSaveFilename.execute(PLACEMENT_OWNER)){
   filename = getSaveFilename.getFilename();
   // do something with filename
   }

This will take care of the case when the user x-es out of the dialog.

                - Jeroen




------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users