How to Get A SubWindow to show

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

How to Get A SubWindow to show

by Turd Turtle :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi there,

I am using fxruby, but should be the same.

I am having the hardest time figuring out how subwindows (forms) are done in FOX.

Is it solely through a FXPopup ?


Ie. In Visual C#, you can just instantiate a "Form" and load it with your GUI widgets. Then "Form".show() it from your main Form.

What is the equivalent in FOX?  Is FXPopup == a Form ?


In particular, I just want to display a PNG in a subwindow once the user clicks a button.  The code I have is:



  def onBtnClick(sender, sel, ptr)
            pane = FXPopup.new(@mainWindow)

    # now load the generated image
    # Make image widget
   @imageview = FXImageView.new(pane,
      :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|HSCROLLER_NEVER|VSCROLLER_NEVER)   
   img = FXPNGImage.new(@mainWindow.getApp(), nil, IMAGE_KEEP|IMAGE_SHMI|IMAGE_SHMP)
    # Load it...
   @mainWindow.getApp().beginWaitCursor do
      FXFileStream.open(filename, FXStreamLoad) { |stream| img.loadPixels(stream) }
      img.create
      @imageview.image = img
   end   

    # Make popup
    pane.create
    pane.popup(nil, 0,0)
    @mainWindow.getApp().runModalWhileShown(pane)
end



Thank you for any help!

Regards,

just another student



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users

Re: How to Get A SubWindow to show

by Jeroen van der Zijp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Friday 28 August 2009, Turd Turtle wrote:
> Hi there,
>
> I am using fxruby, but should be the same.
>
> I am having the hardest time figuring out how subwindows (forms) are done in
> FOX.
>
> Is it solely through a FXPopup ?

FXPopup is meant for popup menus.  I think you're looking for FXDialogBox.

An FXDialogBox can be either free floating, or constrained to be on top
of some other window.  The free-floating variety has FXApp as its "parent"
while the other one has the given window as its "parent".

It is customary to have the latter type be "modal" i.e. interactions with
other windows are blocked while the dialog is up.  

If you call the dialog's "execute()" method then it will be a modal one.

For a non-modal one, you just call "show()" to display it.



Hope this helps,

                - Jeroen


--
+----------------------------------------------------------------------------+
| Copyright (C) 08:10 08/28/2009 Jeroen van der Zijp.   All Rights Reserved. |
+----------------------------------------------------------------------------+

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users

Parent Message unknown Re: How to Get A SubWindow to show

by Jeroen van der Zijp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Friday 28 August 2009, you wrote:
> Hi Jeroen,
>
> Actually -- is there a class I can call that pops up like the DialogBox, and
> also has the standard MainWindow Attributes ("x" to close, minimize,
> maximize, etc) ?

FXMainWindow and FXDialogBox both derive from FXTopWindow; they have common
options for window "decorations", such as DECOR_TITLE, DECOR_BORDER, DECOR_MAXIMIZE,
etc.

Just bitwise OR the options together that you want.  A word of caution: the window-
manager draws these things, FOX doesn't.  So the exact decorations you'll see will
depend on under what window manager you're running...


                - Jeroen




--
+----------------------------------------------------------------------------+
| Copyright (C) 18:50 08/28/2009 Jeroen van der Zijp.   All Rights Reserved. |
+----------------------------------------------------------------------------+

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users

Parent Message unknown Re: How to Get A SubWindow to show

by Jeroen van der Zijp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Friday 28 August 2009, you wrote:
> Hi Jeroen,
>
> Thank you for your speedy reply -- I have one more problem:
>
> When I use .show,  nothing shows; when I use .execute, the dialog pops up
> modally -- am I misusing something?  here is my code, in Ruby:

You're missing a call to create(). The dialog's execute() already calls create()
but show() does not.


                - Jeroen


--
+----------------------------------------------------------------------------+
| Copyright (C) 10:00 08/29/2009 Jeroen van der Zijp.   All Rights Reserved. |
+----------------------------------------------------------------------------+

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users