From paolo.micossi at mac.com Wed Aug 15 09:32:55 2007 From: paolo.micossi at mac.com (Paolo Micossi) Date: Wed, 15 Aug 2007 15:32:55 +0200 Subject: [fxruby-users] Beginner question: handling FXColorDialog cancellation Message-ID: Hello. As part of my first FXRuby project I'm trying to set up things so that the color of some graphic elements gets changed by pressing a button. The button pops up an FXColorDialog and code is supplied to handle the change. I test the value returned by FXColorDialog::execute to detect cancellation and restore the original color, but it does not seem to work. Here is the relevant code fragment: FXButton.new(frame,'Sinusoide',nil,nil,0,LAYOUT_FILL_X| BUTTON_NORMAL).connect(SEL_COMMAND) do d = FXColorDialog.new(self,'Colore Sinusoide') d.rgba = @graph.getPlot('Test Curve').color c = d.rgba d.connect(SEL_COMMAND) do |sender,sel,ev| @graph.getPlot('Test Curve').color = ev end unless d.execute @graph.getPlot('Test Curve').color = c end end Before the FXColorDialog is executed I initialize it with the current color of the object, and also save it in variable "c" for later restore. The dialog shows up with the right initialized color. The color= setter method of the graphic elements sends update messages to the relevant targets, so i can see the color being updated on screen all right while I'm choosing inside the dialog. On dialog exit the color will stay put at the last color chosen in the dialog, regardless of pressing 'Accept' or 'Cancel' Why is it so? Regards, Paolo Micossi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20070815/23807887/attachment.html From jmthomas at ball.com Fri Aug 17 16:12:49 2007 From: jmthomas at ball.com (Thomas, Jason M (Software)) Date: Fri, 17 Aug 2007 14:12:49 -0600 Subject: [fxruby-users] uneditable FXTable cell Message-ID: <03B62622BF273442912A2E486B799DD20582981C@AEROMSG3.AERO.BALL.COM> I'd like to be able to set an individual FXTable cell to uneditable. I tried using disableItem() but this didn't seem to have any affect on whether you could select or change things. I've also tried various things like registering handlers for SEL_COMMAND, SEL_CHANGED, and SEL_SELECTED but that was getting annoying and it still doesn't account for someone just pressing a key and changing a value. I saw I could also handle SEL_KEYPRESS but since that returns a FXEvent rather than a FXTablePos it looked like it was going to be a lot of work to figure out where I was in the table when the keypress occurred. I'd also like to know if there is any way to set the background of my uneditable cell gray. I saw the stipple variable which I set but FXTable renders the stipple color as bright red. That is the opposite of the grey color I'd like to make it to indicate my value is uneditable. Thanks, Jason This message and any enclosures are intended only for the addressee. Please notify the sender by email if you are not the intended recipient. If you are not the intended recipient, you may not use, copy, disclose, or distribute this message or its contents or enclosures to any other person and any such actions may be unlawful. Ball reserves the right to monitor and review all messages and enclosures sent to or from this email address. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20070817/c1ae9d89/attachment.html From lyle.johnson at gmail.com Fri Aug 17 23:07:28 2007 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Fri, 17 Aug 2007 22:07:28 -0500 Subject: [fxruby-users] Beginner question: handling FXColorDialog cancellation In-Reply-To: References: Message-ID: On Aug 15, 2007, at 8:32 AM, Paolo Micossi wrote: > The button pops up an FXColorDialog and code is supplied to handle > the change. I test the value returned by FXColorDialog::execute to > detect cancellation and restore the original color, but it does not > seem to work. The execute() method returns either 0 or 1, so I think the problem has to do with the test that you're using: unless d.execute # ... end The code inside this block will *never* run, because both 0 and 1 evaluate to "true" in Ruby. You should see the expected result for Cancel if you change it to this: if d.execute == 0 @graph.getPlot('Test Curve').color = c end Hope this helps, Lyle From lyle.johnson at gmail.com Sat Aug 18 13:01:47 2007 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Sat, 18 Aug 2007 12:01:47 -0500 Subject: [fxruby-users] uneditable FXTable cell In-Reply-To: <03B62622BF273442912A2E486B799DD20582981C@AEROMSG3.AERO.BALL.COM> References: <03B62622BF273442912A2E486B799DD20582981C@AEROMSG3.AERO.BALL.COM> Message-ID: <99BCB537-9F15-49E2-A3EE-E0DF049CF6D8@gmail.com> On Aug 17, 2007, at 3:12 PM, Thomas, Jason M ((Software)) wrote: > I'd like to be able to set an individual FXTable cell to > uneditable. I tried using disableItem() but this didn't seem to > have any affect on whether you could select or change things. I've > also tried various things like registering handlers for > SEL_COMMAND, SEL_CHANGED, and SEL_SELECTED but that was getting > annoying and it still doesn't account for someone just pressing a > key and changing a value. I saw I could also handle SEL_KEYPRESS > but since that returns a FXEvent rather than a FXTablePos it looked > like it was going to be a lot of work to figure out where I was in > the table when the keypress occurred. You're right; this looks like a bug in FOX. FOX doesn't respond to keypress events or single mouse button clicks on disabled table cells, but it does allow you to (among other things) double-click in a disabled cell and edit its contents. I am Cc'ing Jeroen on this to see if this can be fixed in FOX 1.6. Don't know if he has fixed this in FOX 1.7 yet. > I'd also like to know if there is any way to set the background of > my uneditable cell gray. I saw the stipple variable which I set but > FXTable renders the stipple color as bright red. That is the > opposite of the grey color I'd like to make it to indicate my value > is uneditable. Yep, the default stipple color for FXTable is red (not sure why that was the choice). How does it look for you if you use the STIPPLE_GREY pattern and set the table's stipple color to, say, black? table.stippleColor = "black" table.getItem(3, 4).stipple = STIPPLE_GREY Let's see if that works any better for you. Hope this helps, Lyle -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20070818/fb17162a/attachment-0001.html From glenn at tangelosoftware.net Mon Aug 20 07:06:03 2007 From: glenn at tangelosoftware.net (Glenn Davy) Date: Mon, 20 Aug 2007 21:06:03 +1000 Subject: [fxruby-users] legacy apps with fox12 Message-ID: <200708202106.03710.glenn@tangelosoftware.net> Hi Im looking at ruby gui toolkits and came across this - looks very interesting. I thought i'd look at some of the apps mentioned (mondrian, dbtalk etc) - see whats been done, and what the code looks like, problem is they have dependencies on fox12, which has dependencies on the Fox toolkit 1.2, which doesnt seem to be available anymore. Im working fxruby-1.6 and foxtoolkit 1.6 going, but am wondering will these existing apps work with newer fxrubies than 1.2? thanks glenn From glenn at tangelosoftware.net Mon Aug 20 08:03:35 2007 From: glenn at tangelosoftware.net (Glenn Davy) Date: Mon, 20 Aug 2007 22:03:35 +1000 Subject: [fxruby-users] legacy apps with fox12 In-Reply-To: <200708202106.03710.glenn@tangelosoftware.net> References: <200708202106.03710.glenn@tangelosoftware.net> Message-ID: <200708202203.35642.glenn@tangelosoftware.net> ok - i've answered my own question - the answer is it depends - got some going not others. now i've got another one.... but will ask in seperate post thanks On Mon, 20 Aug 2007 09:06:03 pm Glenn Davy wrote: > Hi > Im looking at ruby gui toolkits and came across this - looks very > interesting. I thought i'd look at some of the apps mentioned (mondrian, > dbtalk etc) - see whats been done, and what the code looks like, problem is > they have dependencies on fox12, which has dependencies on the Fox toolkit > 1.2, which doesnt seem to be available anymore. Im working fxruby-1.6 and > foxtoolkit 1.6 going, but am wondering will these existing apps work with > newer fxrubies than 1.2? > > thanks > glenn > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users From glenn at tangelosoftware.net Mon Aug 20 08:08:03 2007 From: glenn at tangelosoftware.net (Glenn Davy) Date: Mon, 20 Aug 2007 22:08:03 +1000 Subject: [fxruby-users] Print preview widget anyone? Message-ID: <200708202208.03982.glenn@tangelosoftware.net> hi - investigating gui toolkit options for ruby. One of my needs is a print preview type widget, or something that i can lever to use as some form of virtual paper for print preview purposes. Does fox (and more specifically fxruby) have such a thing? I've looked through API and nothings jumping out at me, but perhaps thats just due to unfamiliarity with fox and its wiley ways. Any ideas? thanks Glenn From lyle.johnson at gmail.com Mon Aug 20 08:17:01 2007 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Mon, 20 Aug 2007 07:17:01 -0500 Subject: [fxruby-users] Print preview widget anyone? In-Reply-To: <200708202208.03982.glenn@tangelosoftware.net> References: <200708202208.03982.glenn@tangelosoftware.net> Message-ID: <1FAF003D-C32E-4188-ACC6-4F77239E81E4@gmail.com> On Aug 20, 2007, at 7:08 AM, Glenn Davy wrote: > hi - investigating gui toolkit options for ruby. One of my needs is > a print > preview type widget, or something that i can lever to use as some > form of > virtual paper for print preview purposes. Does fox (and more > specifically > fxruby) have such a thing? I've looked through API and nothings > jumping out > at me, but perhaps thats just due to unfamiliarity with fox and its > wiley > ways. Any ideas? FOX's support for printing in general is pretty non-existent, so I've never heard of anything like this. I will be interested to hear of any other responses. From lyle.johnson at gmail.com Mon Aug 20 08:20:48 2007 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Mon, 20 Aug 2007 07:20:48 -0500 Subject: [fxruby-users] legacy apps with fox12 In-Reply-To: <200708202106.03710.glenn@tangelosoftware.net> References: <200708202106.03710.glenn@tangelosoftware.net> Message-ID: <4484A4D5-B43F-47F2-B15C-BB8E5FBDA2A1@gmail.com> On Aug 20, 2007, at 6:06 AM, Glenn Davy wrote: > Im looking at ruby gui toolkits and came across this - looks very > interesting. > I thought i'd look at some of the apps mentioned (mondrian, dbtalk > etc) - see > whats been done, and what the code looks like, problem is they have > dependencies on fox12, which has dependencies on the Fox toolkit > 1.2, which > doesnt seem to be available anymore. Im working fxruby-1.6 and > foxtoolkit 1.6 > going, but am wondering will these existing apps work with newer > fxrubies > than 1.2? I know that you've already answered your question, but I'd just add that it's really up to the individual application developers to keep them up to date. FOX and FXRuby versions 1.2 are several years old now, and if the application hasn't been touched since then you'd probably want to look for something that's still being maintained (IMO). From jmthomas at ball.com Mon Aug 20 10:42:28 2007 From: jmthomas at ball.com (Thomas, Jason M (Software)) Date: Mon, 20 Aug 2007 08:42:28 -0600 Subject: [fxruby-users] uneditable FXTable cell In-Reply-To: <99BCB537-9F15-49E2-A3EE-E0DF049CF6D8@gmail.com> References: <03B62622BF273442912A2E486B799DD20582981C@AEROMSG3.AERO.BALL.COM> <99BCB537-9F15-49E2-A3EE-E0DF049CF6D8@gmail.com> Message-ID: <03B62622BF273442912A2E486B799DD205829821@AEROMSG3.AERO.BALL.COM> I'd like to be able to set an individual FXTable cell to uneditable. I tried using disableItem() but this didn't seem to have any affect on whether you could select or change things. - Jason You're right; this looks like a bug in FOX. FOX doesn't respond to keypress events or single mouse button clicks on disabled table cells, but it does allow you to (among other things) double-click in a disabled cell and edit its contents. I am Cc'ing Jeroen on this to see if this can be fixed in FOX 1.6. Don't know if he has fixed this in FOX 1.7 yet. - Lyle Actually it looks like it is responding to keypress events and double clicks. Ideally what I'd like is to be able to prevent all user input on a disabled (not editable) cell. - Jason Yep, the default stipple color for FXTable is red (not sure why that was the choice). How does it look for you if you use the STIPPLE_GRAY pattern and set the table's stipple color to, say, black? table.stippleColor = "black" table.getItem(3, 4).stipple = STIPPLE_GRAY - Lyle This worked, thanks. However, stipple isn't the nicest looking thing to apply to a table cell. It makes the text barely readable. What I was really looking for is a way to change the background color to gray similar to the table row and column headers. It didn't look like there was an option to set an individual cell a particular background color. - Jason This message and any enclosures are intended only for the addressee. Please notify the sender by email if you are not the intended recipient. If you are not the intended recipient, you may not use, copy, disclose, or distribute this message or its contents or enclosures to any other person and any such actions may be unlawful. Ball reserves the right to monitor and review all messages and enclosures sent to or from this email address. From lyle.johnson at gmail.com Mon Aug 20 11:18:00 2007 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Mon, 20 Aug 2007 10:18:00 -0500 Subject: [fxruby-users] uneditable FXTable cell In-Reply-To: <03B62622BF273442912A2E486B799DD205829821@AEROMSG3.AERO.BALL.COM> References: <03B62622BF273442912A2E486B799DD20582981C@AEROMSG3.AERO.BALL.COM> <99BCB537-9F15-49E2-A3EE-E0DF049CF6D8@gmail.com> <03B62622BF273442912A2E486B799DD205829821@AEROMSG3.AERO.BALL.COM> Message-ID: <7A4D80CD-800D-4239-8FE5-3443F24C4829@gmail.com> On Aug 20, 2007, at 9:42 AM, Thomas, Jason M ((Software)) wrote: > This worked, thanks. However, stipple isn't the nicest looking > thing to > apply to a table cell. It makes the text barely readable. What I was > really looking for is a way to change the background color to gray > similar to the table row and column headers. It didn't look like there > was an option to set an individual cell a particular background color. No, there isn't an easy way to set the individual cells' background colors. From seamus_0 at yahoo.co.uk Wed Aug 22 08:01:54 2007 From: seamus_0 at yahoo.co.uk (David Kirkpatrick) Date: Wed, 22 Aug 2007 12:01:54 +0000 (GMT) Subject: [fxruby-users] Ruby Fox newbie query Message-ID: <603760.85057.qm@web25415.mail.ukl.yahoo.com> Hi, I'm trying to get to grips with a Ruby GUI and have plunked for Fox and/or FoxGUIb. I'm having problems at the moment trying to do something simple which I can't find in the samples or tutorials how to do. Basically, in my main window, its composed of 2 vertical frames. There is a menu at the top for all the options. All Im trying to do is display text inputs fields in the left vertical frame.This is for user input, to run specific apps. What text fields shown are dependant on the menu option chosen. The right frame is a response screen.Below is some snippets:- ..... My left vertical frame for data input..... @group1 = FXGroupBox.new(contents, "Information", :opts => GROUPBOX_TITLE_LEFT|FRAME_RIDGE|LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT, :width => 200, :height => 400) ...... My menu option....... mymenu = FXMenuPane.new(self) FXMenuTitle.new(menubar, "&Target", nil, mymenu, LAYOUT_LEFT) details=FXMenuCommand.new(mymenu, "&Details").connect(SEL_COMMAND) do FXTextField.new(@group1, 10, :opts => FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_X) end What I thought should have happend in the above snippet was that on selecting the 'mymenu' option, a new text field would be entered into the vertical frame '@group1'. However this doesnt happen. Nothing happens. Ideally, I'd like the command on selecting the menu option to go to a function that changes the look of the vertical frame i.e, showing different text fields dependant on the menu chosen. Im sure its a syntex issue. Can you point me to an example on how this can be done? Thanks, -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20070822/ce8e4e7d/attachment.html From lyle.johnson at gmail.com Wed Aug 22 10:51:31 2007 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Wed, 22 Aug 2007 09:51:31 -0500 Subject: [fxruby-users] Ruby Fox newbie query In-Reply-To: <603760.85057.qm@web25415.mail.ukl.yahoo.com> References: <603760.85057.qm@web25415.mail.ukl.yahoo.com> Message-ID: On Aug 22, 2007, at 7:01 AM, David Kirkpatrick wrote: > I'm trying to get to grips with a Ruby GUI and have plunked for Fox > and/or FoxGUIb. I'm having problems at the moment trying to do > something simple which I can't find in the samples or tutorials how > to do... > ...... My menu option....... > > mymenu = FXMenuPane.new(self) > FXMenuTitle.new(menubar, "&Target", nil, mymenu, LAYOUT_LEFT) > details=FXMenuCommand.new(mymenu, "&Details").connect > (SEL_COMMAND) do > FXTextField.new(@group1, 10, :opts => FRAME_SUNKEN| > FRAME_THICK|LAYOUT_FILL_X) > end > > What I thought should have happend in the above snippet was that on > selecting the 'mymenu' option, a new text field would be entered > into the vertical frame '@group1'. However this doesnt happen. > Nothing happens. You need to add a call to create() for the dynamically created text fields, e.g. details = FXMenuCommand.new(...) details.connect(SEL_COMMAND) do textfield = FXTextField.new(@group1, ...) textfield.create @group1.recalc end The create() creates the server-side resources (windows) for the newly constructed widgets, and calling recalc() on the group box marks its layout as dirty. > Ideally, I'd like the command on selecting the menu option to go to > a function that changes the look of the vertical frame i.e, showing > different text fields dependant on the menu chosen. Im sure its a > syntex issue. > > Can you point me to an example on how this can be done? I'm not sure I follow you. You can just call a function from inside the connect() block, e.g. details.connect(SEL_COMMAND) { update_groupbox_contents } and then, somewhere else: def update_groupbox_contents textfield = FXTextField.new(@group1, ...) textfield.create @group1.recalc end Hope this helps, Lyle From lyle.johnson at gmail.com Wed Aug 22 17:53:11 2007 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Wed, 22 Aug 2007 16:53:11 -0500 Subject: [fxruby-users] Ruby Fox newbie query In-Reply-To: <375180.32791.qm@web25412.mail.ukl.yahoo.com> References: <375180.32791.qm@web25412.mail.ukl.yahoo.com> Message-ID: <69192B6C-0A32-4C80-8848-CE6B68553A12@gmail.com> On Aug 22, 2007, at 11:13 AM, David Kirkpatrick wrote: > That did the trick. thanks a lot. Basically u need to 'create' > anything in a frame, and do a 'recalc' on the frame each time the > output changes. Yes. > Is there anywhere where that sort of info is documented? I trawled > for a couple of days over the tutorials etc. with no obvious > solution. My app is going to be an ongoing thing, so if there's any > good material I missed can u point me in the right direction. Any > reference to those sorts of functions would be good. Hypothetically speaking, someone might be writing a book about FXRuby that should be published later this year. But that doesn't help you in the short term. The best resources, for now, are the documentation at the FOX web site (http://www.fox-toolkit.org/) and the FXRuby web site (http://www.fxruby.org/). There's also some coverage of FXRuby in Hal Fulton's book The Ruby Way (2nd ed.), which is a good book to have in general if you're doing Ruby work. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20070822/9812170d/attachment-0001.html From sander at knology.net Thu Aug 23 23:37:06 2007 From: sander at knology.net (Sander Jansen) Date: Thu, 23 Aug 2007 22:37:06 -0500 Subject: [fxruby-users] Ruby Fox newbie query In-Reply-To: <69192B6C-0A32-4C80-8848-CE6B68553A12@gmail.com> References: <375180.32791.qm@web25412.mail.ukl.yahoo.com> <69192B6C-0A32-4C80-8848-CE6B68553A12@gmail.com> Message-ID: <46CE5262.8050403@knology.net> > > Hypothetically speaking, someone might be writing a book about FXRuby > that should be published later this year. The real question, hypothetically speaking that is, is whether there'll be a release party... And, hypothetically speaking, will there be beer... Sander > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users From seamus_0 at yahoo.co.uk Fri Aug 24 04:15:58 2007 From: seamus_0 at yahoo.co.uk (David Kirkpatrick) Date: Fri, 24 Aug 2007 08:15:58 +0000 (GMT) Subject: [fxruby-users] Ruby Fox newbie query Message-ID: <204319.16647.qm@web25413.mail.ukl.yahoo.com> I'll drink to that !! Till then I'll battle on.... ta ----- Original Message ---- From: Sander Jansen To: fxruby-users at rubyforge.org Sent: Friday, 24 August, 2007 4:37:06 AM Subject: Re: [fxruby-users] Ruby Fox newbie query > > Hypothetically speaking, someone might be writing a book about FXRuby > that should be published later this year. The real question, hypothetically speaking that is, is whether there'll be a release party... And, hypothetically speaking, will there be beer... Sander > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users _______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20070824/458b4cb8/attachment.html From jmthomas at ball.com Fri Aug 24 11:37:52 2007 From: jmthomas at ball.com (Thomas, Jason M (Software)) Date: Fri, 24 Aug 2007 09:37:52 -0600 Subject: [fxruby-users] setting the font in FXText Message-ID: <03B62622BF273442912A2E486B799DD205829835@AEROMSG3.AERO.BALL.COM> I have subclassed a FXDialogBox and put a FXText in it for displaying a hex dump in my application. I want to change the font to a courier type font since it's a hex dump. When do the following it works as expected: # A little dialog box to use in our tests class FXTextDialog < FXDialogBox def initialize(owner) # Invoke base class initialize function first super(owner, "Temp", DECOR_TITLE|DECOR_BORDER, 0, 0, 200, 200) button = FXHorizontalFrame.new(self, LAYOUT_SIDE_BOTTOM|FRAME_NONE|LAYOUT_FILL_X|PACK_UNIFORM_WIDTH) contents = FXHorizontalFrame.new(self, LAYOUT_SIDE_TOP|FRAME_NONE|LAYOUT_FILL_X|LAYOUT_FILL_Y|PACK_UNIFORM_WIDT H) @fxtext = FXText.new(contents, nil, 0, TEXT_READONLY|TEXT_WORDWRAP|LAYOUT_FILL_X|LAYOUT_FILL_Y) @fxtext.font = FXFont.new(getApp(), "courier", 8) # Ok button ok = FXButton.new(button, "OK", nil, self, ID_CANCEL, FRAME_RAISED|FRAME_THICK|LAYOUT_CENTER_X|LAYOUT_CENTER_Y|LAYOUT_FILL_X) ok.setDefault ok.setFocus end end However, when I add the following method to FXTextDialog and call it I get a Seg Fault!: def set_font() @fxtext.font = FXFont.new(getApp(), "courier", 8) end Usage in my application: def onTableHex(sender, sel, ptr) @dialog = FXTextDialog.new(self) @dialog.set_font() @dialog.show end How do I set my font once I have already created the dialog box or is this possible? Jason This message and any enclosures are intended only for the addressee. Please notify the sender by email if you are not the intended recipient. If you are not the intended recipient, you may not use, copy, disclose, or distribute this message or its contents or enclosures to any other person and any such actions may be unlawful. Ball reserves the right to monitor and review all messages and enclosures sent to or from this email address. From jmthomas at ball.com Fri Aug 24 11:45:32 2007 From: jmthomas at ball.com (Thomas, Jason M (Software)) Date: Fri, 24 Aug 2007 09:45:32 -0600 Subject: [fxruby-users] FXComboTableItem bug Message-ID: <03B62622BF273442912A2E486B799DD205829836@AEROMSG3.AERO.BALL.COM> I think there is a bug in FXComboTableItem when using it with FXTable. I was getting a Seg Fault before making the following change: class FXComboTableItem < FXTableItem # Create input control for editing this item def getControlFor(table) combo = FXComboBox.new(table, 1, nil, 0, COMBOBOX_STATIC, 0, 0, 0, 0, table.marginLeft, table.marginRight, table.marginTop, table.marginBottom) combo.create combo.justify = justify combo.font = table.font combo.backColor = table.backColor combo.textColor = table.textColor combo.selBackColor = table.selBackColor combo.selTextColor = table.selTextColor selections.each do |selection| combo.appendItem(selection) end combo.numVisible = [20, combo.numItems].min combo end End The original code used combo.fillItems(selections) instead of combo.appendItem so I think that's where the problem is. Jason This message and any enclosures are intended only for the addressee. Please notify the sender by email if you are not the intended recipient. If you are not the intended recipient, you may not use, copy, disclose, or distribute this message or its contents or enclosures to any other person and any such actions may be unlawful. Ball reserves the right to monitor and review all messages and enclosures sent to or from this email address. From lyle.johnson at gmail.com Fri Aug 24 11:47:53 2007 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Fri, 24 Aug 2007 10:47:53 -0500 Subject: [fxruby-users] setting the font in FXText In-Reply-To: <03B62622BF273442912A2E486B799DD205829835@AEROMSG3.AERO.BALL.COM> References: <03B62622BF273442912A2E486B799DD205829835@AEROMSG3.AERO.BALL.COM> Message-ID: <682885C0-02D7-4BBA-89F3-9C24E57CE630@gmail.com> On Aug 24, 2007, at 10:37 AM, Thomas, Jason M ((Software)) wrote: > How do I set my font once I have already created the dialog box or is > this possible? You need to call create() on the font before you assign it: def set_font() font = FXFont.new(getApp(), "courier", 8) font.create @fxtext.font = font end There's also an entry about this in the FOX FAQ (see http://www.fox- toolkit.org/). Hope this helps, Lyle From rmelton at ball.com Fri Aug 24 11:47:57 2007 From: rmelton at ball.com (Melton, Ryan) Date: Fri, 24 Aug 2007 09:47:57 -0600 Subject: [fxruby-users] setting the font in FXText In-Reply-To: <03B62622BF273442912A2E486B799DD205829835@AEROMSG3.AERO.BALL.COM> References: <03B62622BF273442912A2E486B799DD205829835@AEROMSG3.AERO.BALL.COM> Message-ID: <2EC28B773AF39E47850AC45765483C2C07E45122@AEROMSG2.AERO.BALL.COM> I think you need to call create on the font before using it like so: def set_font() myfont = FXFont.new(getApp(), "courier", 8) myfont.create @fxtext.font = myfont end -----Original Message----- From: fxruby-users-bounces at rubyforge.org [mailto:fxruby-users-bounces at rubyforge.org] On Behalf Of Thomas, Jason M (Software) Sent: Friday, August 24, 2007 9:38 AM To: fxruby-users at rubyforge.org Subject: [fxruby-users] setting the font in FXText I have subclassed a FXDialogBox and put a FXText in it for displaying a hex dump in my application. I want to change the font to a courier type font since it's a hex dump. When do the following it works as expected: # A little dialog box to use in our tests class FXTextDialog < FXDialogBox def initialize(owner) # Invoke base class initialize function first super(owner, "Temp", DECOR_TITLE|DECOR_BORDER, 0, 0, 200, 200) button = FXHorizontalFrame.new(self, LAYOUT_SIDE_BOTTOM|FRAME_NONE|LAYOUT_FILL_X|PACK_UNIFORM_WIDTH) contents = FXHorizontalFrame.new(self, LAYOUT_SIDE_TOP|FRAME_NONE|LAYOUT_FILL_X|LAYOUT_FILL_Y|PACK_UNIFORM_WIDT H) @fxtext = FXText.new(contents, nil, 0, TEXT_READONLY|TEXT_WORDWRAP|LAYOUT_FILL_X|LAYOUT_FILL_Y) @fxtext.font = FXFont.new(getApp(), "courier", 8) # Ok button ok = FXButton.new(button, "OK", nil, self, ID_CANCEL, FRAME_RAISED|FRAME_THICK|LAYOUT_CENTER_X|LAYOUT_CENTER_Y|LAYOUT_FILL_X) ok.setDefault ok.setFocus end end However, when I add the following method to FXTextDialog and call it I get a Seg Fault!: def set_font() @fxtext.font = FXFont.new(getApp(), "courier", 8) end Usage in my application: def onTableHex(sender, sel, ptr) @dialog = FXTextDialog.new(self) @dialog.set_font() @dialog.show end How do I set my font once I have already created the dialog box or is this possible? Jason This message and any enclosures are intended only for the addressee. Please notify the sender by email if you are not the intended recipient. If you are not the intended recipient, you may not use, copy, disclose, or distribute this message or its contents or enclosures to any other person and any such actions may be unlawful. Ball reserves the right to monitor and review all messages and enclosures sent to or from this email address. _______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users This message and any enclosures are intended only for the addressee. Please notify the sender by email if you are not the intended recipient. If you are not the intended recipient, you may not use, copy, disclose, or distribute this message or its contents or enclosures to any other person and any such actions may be unlawful. Ball reserves the right to monitor and review all messages and enclosures sent to or from this email address. From jmthomas at ball.com Fri Aug 24 17:49:00 2007 From: jmthomas at ball.com (Thomas, Jason M (Software)) Date: Fri, 24 Aug 2007 15:49:00 -0600 Subject: [fxruby-users] FXTable tooltips Message-ID: <03B62622BF273442912A2E486B799DD20582983C@AEROMSG3.AERO.BALL.COM> Is there any way to add tooltips to a FXTable? I'd especially like to have a tooltip on the row and column headers. Thanks, Jason This message and any enclosures are intended only for the addressee. Please notify the sender by email if you are not the intended recipient. If you are not the intended recipient, you may not use, copy, disclose, or distribute this message or its contents or enclosures to any other person and any such actions may be unlawful. Ball reserves the right to monitor and review all messages and enclosures sent to or from this email address. From jmthomas at ball.com Mon Aug 27 12:00:03 2007 From: jmthomas at ball.com (Thomas, Jason M (Software)) Date: Mon, 27 Aug 2007 10:00:03 -0600 Subject: [fxruby-users] FXTable tooltips Message-ID: <03B62622BF273442912A2E486B799DD205829840@AEROMSG3.AERO.BALL.COM> My FXTable appears to support tooltips because when I mouse over a column or row header it pops up the same text in the header itself. How do I set this text to my own custom value? I don't see any methods for it and using "Header Text\tTip Text" as the header value doesn't seem to work. Thanks, Jason This message and any enclosures are intended only for the addressee. Please notify the sender by email if you are not the intended recipient. If you are not the intended recipient, you may not use, copy, disclose, or distribute this message or its contents or enclosures to any other person and any such actions may be unlawful. Ball reserves the right to monitor and review all messages and enclosures sent to or from this email address. From lyle.johnson at gmail.com Mon Aug 27 15:52:06 2007 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Mon, 27 Aug 2007 14:52:06 -0500 Subject: [fxruby-users] FXComboTableItem bug In-Reply-To: <03B62622BF273442912A2E486B799DD205829836@AEROMSG3.AERO.BALL.COM> References: <03B62622BF273442912A2E486B799DD205829836@AEROMSG3.AERO.BALL.COM> Message-ID: On Aug 24, 2007, at 10:45 AM, Thomas, Jason M ((Software)) wrote: > I think there is a bug in FXComboTableItem when using it with > FXTable. I > was getting a Seg Fault before making the following change: Thanks for the info. I have filed a bug report on your behalf, here: http://rubyforge.org/tracker/index.php? func=detail&aid=13436&group_id=300&atid=1223 Lyle From lyle.johnson at gmail.com Mon Aug 27 15:58:23 2007 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Mon, 27 Aug 2007 14:58:23 -0500 Subject: [fxruby-users] FXTable tooltips In-Reply-To: <03B62622BF273442912A2E486B799DD20582983C@AEROMSG3.AERO.BALL.COM> References: <03B62622BF273442912A2E486B799DD20582983C@AEROMSG3.AERO.BALL.COM> Message-ID: <9F7861FB-15D3-42A0-9458-D823C16F6C94@gmail.com> On Aug 24, 2007, at 4:49 PM, Thomas, Jason M ((Software)) wrote: > Is there any way to add tooltips to a FXTable? I'd especially like to > have a tooltip on the row and column headers. Sorry for the delay in responding to this, I've been traveling a lot. I assume that by now you've see Jeroen's answer to Ryan's question on the FOX Users' Mailing List, here: http://tinyurl.com/35qrm3 Hope this helps, Lyle From jmthomas at ball.com Mon Aug 27 16:02:05 2007 From: jmthomas at ball.com (Thomas, Jason M (Software)) Date: Mon, 27 Aug 2007 14:02:05 -0600 Subject: [fxruby-users] FXTable tooltips In-Reply-To: <9F7861FB-15D3-42A0-9458-D823C16F6C94@gmail.com> References: <03B62622BF273442912A2E486B799DD20582983C@AEROMSG3.AERO.BALL.COM> <9F7861FB-15D3-42A0-9458-D823C16F6C94@gmail.com> Message-ID: <03B62622BF273442912A2E486B799DD205829844@AEROMSG3.AERO.BALL.COM> So it sounds like I have to wait until 1.7 is released. What is your release procedure with respect to FOX releases? Jason -----Original Message----- From: Lyle Johnson [mailto:lyle.johnson at gmail.com] Sent: Monday, August 27, 2007 1:58 PM To: Thomas, Jason M (Software) Cc: fxruby-users at rubyforge.org Subject: Re: [fxruby-users] FXTable tooltips On Aug 24, 2007, at 4:49 PM, Thomas, Jason M ((Software)) wrote: > Is there any way to add tooltips to a FXTable? I'd especially like to > have a tooltip on the row and column headers. Sorry for the delay in responding to this, I've been traveling a lot. I assume that by now you've see Jeroen's answer to Ryan's question on the FOX Users' Mailing List, here: http://tinyurl.com/35qrm3 Hope this helps, Lyle This message and any enclosures are intended only for the addressee. Please notify the sender by email if you are not the intended recipient. If you are not the intended recipient, you may not use, copy, disclose, or distribute this message or its contents or enclosures to any other person and any such actions may be unlawful. Ball reserves the right to monitor and review all messages and enclosures sent to or from this email address. From lyle.johnson at gmail.com Mon Aug 27 16:11:41 2007 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Mon, 27 Aug 2007 15:11:41 -0500 Subject: [fxruby-users] FXTable tooltips In-Reply-To: <03B62622BF273442912A2E486B799DD205829844@AEROMSG3.AERO.BALL.COM> References: <03B62622BF273442912A2E486B799DD20582983C@AEROMSG3.AERO.BALL.COM> <9F7861FB-15D3-42A0-9458-D823C16F6C94@gmail.com> <03B62622BF273442912A2E486B799DD205829844@AEROMSG3.AERO.BALL.COM> Message-ID: <6A5E9412-0A89-4A17-BA09-C10F04D239D1@gmail.com> On Aug 27, 2007, at 3:02 PM, Thomas, Jason M ((Software)) wrote: > So it sounds like I have to wait until 1.7 is released. What is your > release procedure with respect to FOX releases? At some point in the future, Jeroen will decide that he's finished with the work that he's doing on the 1.7 branch, and he'll release that as FOX 1.8. At some point after that---usually within a month or so---I'll release FXRuby 1.8. From lyle.johnson at gmail.com Tue Aug 28 10:50:47 2007 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Tue, 28 Aug 2007 09:50:47 -0500 Subject: [fxruby-users] FXTable tooltips In-Reply-To: <03B62622BF273442912A2E486B799DD205829840@AEROMSG3.AERO.BALL.COM> References: <03B62622BF273442912A2E486B799DD205829840@AEROMSG3.AERO.BALL.COM> Message-ID: <254B5E1A-1BA9-437E-8631-C95A2197AF6F@gmail.com> On Aug 27, 2007, at 11:00 AM, Thomas, Jason M ((Software)) wrote: > My FXTable appears to support tooltips because when I mouse over a > column or row header it pops up the same text in the header itself. > How > do I set this text to my own custom value? There's not a convenient way to do this in FXRuby 1.6, but I just tried this and it seems to work: # Override default tooltips for the column header table.columnHeader.connect(SEL_QUERY_TIP) do |sender, sel, ptr| x, y, btns = table.columnHeader.getCursorPosition() index = table.columnHeader.getItemAt(x) if index >= 0 && index < table.columnHeader.numItems sender.text = "tooltip text for item #{index}" end end If you're doing it for the row header, be sure to call getItemAt(y) instead of getItemAt(x). Per Jeroen, this should be much more straightforward in FOX and FXRuby 1.8. Hope this helps, Lyle From jmthomas at ball.com Tue Aug 28 16:18:43 2007 From: jmthomas at ball.com (Thomas, Jason M (Software)) Date: Tue, 28 Aug 2007 14:18:43 -0600 Subject: [fxruby-users] FXTable tooltips In-Reply-To: <254B5E1A-1BA9-437E-8631-C95A2197AF6F@gmail.com> References: <03B62622BF273442912A2E486B799DD205829840@AEROMSG3.AERO.BALL.COM> <254B5E1A-1BA9-437E-8631-C95A2197AF6F@gmail.com> Message-ID: <03B62622BF273442912A2E486B799DD205829849@AEROMSG3.AERO.BALL.COM> This is exactly what I was looking for, thanks! I found it also works for FXTabItems in a FXTabBook. My code looks like this: tab = FXTabItem.new(@tabbook, "&#{name}", nil) tab.connect(SEL_QUERY_TIP, method(:onTableTabMouseover)) ... def onTableTabMouseover(sender, sel, ptr) sender.text = my_tab_text End It looks like to me you can connect a method to SEL_QUERY_TIP on just about anything to override the tool tip text. Jason -----Original Message----- From: Lyle Johnson [mailto:lyle.johnson at gmail.com] Sent: Tuesday, August 28, 2007 8:51 AM To: Thomas, Jason M (Software) Cc: fxruby-users at rubyforge.org Subject: Re: [fxruby-users] FXTable tooltips On Aug 27, 2007, at 11:00 AM, Thomas, Jason M ((Software)) wrote: > My FXTable appears to support tooltips because when I mouse over a > column or row header it pops up the same text in the header itself. > How > do I set this text to my own custom value? There's not a convenient way to do this in FXRuby 1.6, but I just tried this and it seems to work: # Override default tooltips for the column header table.columnHeader.connect(SEL_QUERY_TIP) do |sender, sel, ptr| x, y, btns = table.columnHeader.getCursorPosition() index = table.columnHeader.getItemAt(x) if index >= 0 && index < table.columnHeader.numItems sender.text = "tooltip text for item #{index}" end end If you're doing it for the row header, be sure to call getItemAt(y) instead of getItemAt(x). Per Jeroen, this should be much more straightforward in FOX and FXRuby 1.8. Hope this helps, Lyle This message and any enclosures are intended only for the addressee. Please notify the sender by email if you are not the intended recipient. If you are not the intended recipient, you may not use, copy, disclose, or distribute this message or its contents or enclosures to any other person and any such actions may be unlawful. Ball reserves the right to monitor and review all messages and enclosures sent to or from this email address.