From naldo_ds at yahoo.com.br Sat May 1 10:44:37 2010 From: naldo_ds at yahoo.com.br (Reginaldo Francisco) Date: Sat, 01 May 2010 11:44:37 -0300 Subject: [fxruby-users] i18n messages In-Reply-To: References: <4BD642CB.8070209@yahoo.com.br> <006e01cae6a2$3cc5b200$b6511600$@com> <4BD84601.3020706@yahoo.com.br> Message-ID: <4BDC3E55.8010009@yahoo.com.br> Joey, your FXTranslator sample code solved completely my problem! Thank you very much, and everybody who helped me too. Reginaldo Francisco naldo_ds at yahoo.com.br Em 28/04/2010 12:43, Joey Kinsella escreveu: > After further investigation, it's as easy as this: > > require 'fox16' > include Fox > > # Create a Translation Class > class ExampleTranslator < FXTranslator > # tr() is called to translate the text > # c = context > # m = message > # h = hint > def tr(c, m, h) > # here you would probably do something like Paul did with a file > to map stuff, but for an example I just matched on > # one string. > if(m == "Print Destination") > # if text matches "Print Destination" translate to "Something > totally different" > return ("Something totally different") > end > > # otherwise we just return the message. > return (m) > end > end > # End example Translation class. > > # Basic stuff.. > app = FXApp.new("Test", "Test") > > # Set the translator for our application to be our Translator > app.translator = ExampleTranslator.new(app) > > # More basic stuff. > win = FXMainWindow.new(app, "Test App", :opts => DECOR_ALL) > pd = FXPrintDialog.new(win, "Test") > > app.create > win.show > pd.show > > app.run > > -------------------------------------------- > > I realized after sending my email that the tr() function in > FXTranslator was virtual, and intended to be overwritten > by self-written algorithms. > > Good luck :) > > On Wed, Apr 28, 2010 at 10:28 AM, Reginaldo Francisco > > wrote: > > > Glancing through the FXRuby source I don't see anything > additional or different being done for the FXTranslator > object. but that's just a glance.. Further investigation could > yield something else. > > > It's that Joey, I did not find anything to do that, even how to > use a FXTranslator! > > > Reginaldo Francisco > naldo_ds at yahoo.com.br > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > > > -- > If you are not the intended recipient, you are hereby notified > that any dissemination, distribution, copying or other use of > this communication is strictly prohibited. If you have > received this communication in error, please notify us > immediately. > > > > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From jkinsella at ancillaryservices.com Wed May 5 10:14:03 2010 From: jkinsella at ancillaryservices.com (Joey Kinsella) Date: Wed, 5 May 2010 10:14:03 -0400 Subject: [fxruby-users] Preventing a parent window from closing Message-ID: FXRuby users, Is it possible to prevent a parent window from closing when a child window is open. I know I could probably do this with some kind of global variable in the main window object, and basically have some kind of "reference" count that if not equal to 0, it will not close the window. Then each time a child window closes the reference count gets decremented by 1. ie: --- BEGIN SNIPPET --- #! /usr/bin/env ruby require 'fox16' include Fox class SimpleApp < FXMainWindow def initialize(app) super(app,"Simple Test App", nil,nil, DECOR_ALL, 0,0, 640,480) @winref = 0 FXButton.new(self, "Click Me").connect(SEL_COMMAND) do @winref += 1 aw = AnotherWin.new(app) aw.create aw.connect(SEL_CLOSE) do @winref -= 1 end end end def close(notify = false) ## popup a message. ## return if(@winref != 0) super(notify) end def create super show(PLACEMENT_SCREEN) end end class AnotherWin < FXMainWindow def initialize(app) super(app,"Another window", nil,nil, DECOR_ALL, 0,0, 320,260) end def create super show(PLACEMENT_SCREEN) end end app = FXApp.new("Test","Test") SimpleApp.new(app) app.create app.run --- END SNIPPET --- I was curious if there was a better way of doing this, perhaps something in the underlying routines in the Fox library. Perhaps I shouldn't be using FXMainWindow as a child window? For now, I will probably end up using this implementation, but I hope to hear back on a better way of doing this. -- If you are not the intended recipient, you are hereby notified that any dissemination, distribution, copying or other use of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately. -------------- next part -------------- An HTML attachment was scrubbed... URL: From wbparsons at cshore.com Tue May 18 16:54:22 2010 From: wbparsons at cshore.com (William B. Parsons) Date: Tue, 18 May 2010 16:54:22 -0400 Subject: [fxruby-users] attaching tooltip to FXTable Message-ID: <20100518165422.be9afe73.wbparsons@cshore.com> I'd like to attach a tooltop to an FXTable such that the text displayed will depend on where the mouse pointer is within the table. After googling, it seems the trick to associate a tooltip with a widget that doesn't already support it is: connect(SEL_QUERY_TIP) do |sender, selector, data| sender.handle(self, FXSEL(SEL_COMMAND, ID_SETSTRINGVALUE), 'XXXX') end The problem is how to replace 'XXXX' with text that depends on which cell the mouse is hovering over. I thought the first step might be to catch the mouse co-ordinates when the mouse moves, but the following does't seem to work, regardless of which window it's attached to: connect(SEL_MOTION) do |sender, selector, event| puts "#{event.win_x},#{event.win_y}" end -- Will From myocean135 at yahoo.cn Sun May 30 02:48:29 2010 From: myocean135 at yahoo.cn (Pengpeng) Date: Sun, 30 May 2010 14:48:29 +0800 (CST) Subject: [fxruby-users] can i input chinese into fxruby textfield? Message-ID: <914884.90235.qm@web92104.mail.cnh.yahoo.com> i run a fxruby program ,can't input chinese? in fxruby text field, my chinese input soft can't open, how can i input chinese? in fxruby? gui? -------------- next part -------------- An HTML attachment was scrubbed... URL: From meinrad.recheis at gmail.com Sun May 30 10:06:37 2010 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Sun, 30 May 2010 16:06:37 +0200 Subject: [fxruby-users] can i input chinese into fxruby textfield? In-Reply-To: <914884.90235.qm@web92104.mail.cnh.yahoo.com> References: <914884.90235.qm@web92104.mail.cnh.yahoo.com> Message-ID: On Sun, May 30, 2010 at 8:48 AM, Pengpeng wrote: > i run a fxruby program ,can't input chinese in fxruby text field, my > chinese input soft can't open, how can i input chinese in fxruby gui? > I don't know about compatitbility with different input methods.I can assure that fxruby is able to render chinese, though. ;) Did you try the standard windows input tools or some specific one? What OS are you running fxruby on? Cheers, -- henon -------------- next part -------------- An HTML attachment was scrubbed... URL: