Professional Web Applications Themes

Maximizing an MDI child window in a FXRuby application - Ruby

Hi all, I'm trying to figure out how to write a small application that's just capable of displaying some text in child windows. (I reduced the "mditest.rbw" script that comes with FXRuby to show the problem I have). My problem is: If I run the script below and maximize the chlid window, there's no way to resize it. The three widgets on the top right (child) window corner will dissaprear (The "under score", "square" and "X" icons to minimize, close and maximize the window). # Originally written on this config: # Ruby version: 1.8.0 / 2003-08-04 # Dave & Andy's ...

  1. #1

    Default Maximizing an MDI child window in a FXRuby application

    Hi all,

    I'm trying to figure out how to write a small application that's just capable of displaying some
    text in child windows. (I reduced the "mditest.rbw" script that comes with FXRuby to show the
    problem I have).

    My problem is:
    If I run the script below and maximize the chlid window, there's no way to resize it.
    The three widgets on the top right (child) window corner will dissaprear (The "under score",
    "square" and "X" icons to minimize, close and maximize the window).

    # Originally written on this config:
    # Ruby version: 1.8.0 / 2003-08-04
    # Dave & Andy's 1-click-installer
    # with the latest FXRuby added to it
    #
    # System type: i386-mswin32
    # FXRuby Version: 1.0.27
    # FOX Version: 1.0.46

    require "fox"
    require "fox/responder"
    include Fox

    class Bb < FXMainWindow

    include Responder

    def initialize( app )

    super( app, "Bare Bones...", nil, nil, DECOR_ALL, 0, 0, 500, 400, 0, 0 )
    menubar = createMenu
    mdiclient = FXMDIClient.new( self, LAYOUT_FILL_X | LAYOUT_FILL_Y )
    mdichild = createTestWindow( 10, 10, 400, 300 )
    mdiclient.setActiveChild( mdichild )

    end

    def createMenu
    menuBar = FXMenubar.new( self, LAYOUT_SIDE_TOP | LAYOUT_FILL_X )
    fileMenu = FXMenuPane.new( self )
    FXMenuCommand.new( fileMenu, "&Quit", nil, app, FXApp::ID_QUIT )
    FXMenuTitle.new( menuBar, "&File", nil, fileMenu )
    return menuBar
    end

    # Create a new MDI child window
    def createTestWindow( x, y, w, h )
    mdichild = FXMDIChild.new(mdiclient, "Child", nil, nil, 0, x, y, w, h )
    scrollwindow = FXScrollWindow.new( mdichild, 0 )
    text = FXText.new( scrollwindow, mdichild, LAYOUT_FIX_WIDTH | LAYOUT_FIX_HEIGHT, 0, 0, 0, 100 )
    text.text = "A Rose is a rose is a rose.\n\n Gertrude Stein"
    mdichild
    end

    def Bb.run
    application = FXApp.new( "Bare bones ...", "Stephan Kämper" )
    application.init( ARGV )
    main = Bb.new( application )
    application.create()
    main.show( PLACEMENT_SCREEN )
    application.run()
    end
    end

    if __FILE__ == $0
    Bb.run
    end

    Stephan Kämper Guest

  2. #2

    Default Re: Maximizing an MDI child window in a FXRuby application

    Stephan Kämper wrote:
    > I'm trying to figure out how to write a small application that's just
    > capable of displaying some text in child windows. (I reduced the
    > "mditest.rbw" script that comes with FXRuby to show the problem I have).
    >
    > My problem is:
    > If I run the script below and maximize the chlid window, there's no way
    > to resize it.
    > The three widgets on the top right (child) window corner will dissaprear
    > (The "under score", "square" and "X" icons to minimize, close and
    > maximize the window).
    Well, the short answer is, compare your reduced program to the original
    mditest.rbw example and figure out what you took out ;)

    But here's a hint: look at the section of the original mditest.rb
    example program that begins with the comment "MDI buttons in menu..."
    and copy the code that creates any of the buttons that you're interested
    in. In your case, it sounds like you want to add an FXMDIDeleteButton,
    FXMDIRestoreButton and FXMDIMinimizeButton to the main menu bar.

    Lyle Johnson Guest

  3. #3

    Default Re: Maximizing an MDI child window in a FXRuby application


    Lyle Johnson wrote:
    > Well, the short answer is, compare your reduced program to the original
    > mditest.rbw example and figure out what you took out ;)
    >
    Oh dear. Being able to read is such a Good Thing. ;-) Perhaps it should actually do it. Blush...
    (Now that I _have_ read it, I actually understand what the comment says... )

    Thanks Lyle!


    Happy Rubying


    StePhan

    Stephan Kämper Guest

Similar Threads

  1. How to access child application objects?
    By huhgawz in forum Macromedia Flex General Discussion
    Replies: 1
    Last Post: August 24th, 07:42 PM
  2. Child window property window.opener null after postback
    By MrFez in forum ASP.NET Security
    Replies: 1
    Last Post: April 28th, 06:43 PM
  3. Acessing parent window from child on a Mac
    By John Holmes in forum ASP
    Replies: 1
    Last Post: August 20th, 05:27 AM
  4. Replies: 2
    Last Post: June 30th, 06:37 PM
  5. Child window close/session problem
    By Xing Rong in forum ASP
    Replies: 0
    Last Post: June 30th, 06:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139