Sergueï Cambour
2010-Mar-23 15:18 UTC
[fxruby-users] fxruby-users Digest, Vol 66, Issue 12 (adding FXCalendare component)
Yeas, thanks a lot, it works after adding the below line, as you sugested: require ''fox16/calendar'' 2010/3/23 <fxruby-users-request at rubyforge.org>> Send fxruby-users mailing list submissions to > fxruby-users at rubyforge.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://rubyforge.org/mailman/listinfo/fxruby-users > or, via email, send a message with subject or body ''help'' to > fxruby-users-request at rubyforge.org > > You can reach the person managing the list at > fxruby-users-owner at rubyforge.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fxruby-users digest..." > > > Today''s Topics: > > 1. Re: How do you enable a button for any option change in UI? > (Lyle Johnson) > 2. how to use FXCalendar widget (Sergue? Cambour) > 3. Re: how to use FXCalendar widget (Joey Kinsella) > 4. Re: How do you enable a button for any option change in UI? > (Paul Carvalho) > 5. Re: foxGUIb - how do you insert a title bar icon? (Paul Carvalho) > 6. Re: How do you enable a button for any option change in UI? > (Lyle Johnson) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 23 Mar 2010 08:46:10 -0500 > From: Lyle Johnson <lyle at lylejohnson.name> > To: fxruby-users at rubyforge.org > Subject: Re: [fxruby-users] How do you enable a button for any option > change in UI? > Message-ID: > <57cf8f721003230646ja2a7b7l179d34214b9b6ae3 at mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > On Mon, Mar 22, 2010 at 11:11 PM, Paul Carvalho <tester.paul at gmail.com> > wrote: > > > On 22 March 2010 16:10, Lyle Johnson wrote: > >> > >> Elsewhere in my code, I''d set @config_changed to false whenever the > >> user clicked "Save Config", or to false whenever they made a change to > >> one of the config values. > > > > This is the part that I wanted help with.? How does the app know if/when > > _any_ option has changed?? Do I need to iterate through every option and > > check for status change?? Is there a method that tells me when an object > has > > changed from when it was first drawn/created? > > Almost every widget that can be "clicked" sends a SEL_COMMAND message > to its target whenever it gets clicked. This is true for basic > buttons, but also for radio buttons, check buttons, etc. I would have > assumed that you were already reacting to these messages anyways. But > anyways, so, it''s not exactly that you''re iterating through all of the > options constantly, but you''d just watch for when they change, e.g. > > @option1 = FXCheckButton.new(...) > @option1.connect(SEL_COMMAND) do > # the user clicked this check button to turn the option "on" or > "off"... > @config_changed = true > end > > >> > >> That sounds like a good job for the registry (FXRegistry) service. > > > > Interesting.? I found some info at > http://www.fox-toolkit.com/registry.html > > but no examples that I can learn from.? Do you know of any examples?? I > like > > using the button.rb script for testing with.? If I can figure out how to > > load/save the settings for that program, I should be able to transfer it > to > > my app. > > Sure, take a look at the imageviewer.rb example program that comes > with FXRuby. In the ImageWindow#onCmdQuit method you see examples of > how to write application settings out to the registry; in > ImageWindow#create, you see the opposite (reading those saved settings > back into the application). > > > ------------------------------ > > Message: 2 > Date: Tue, 23 Mar 2010 15:01:05 +0100 > From: Sergue? Cambour <s.cambour at gmail.com> > To: fxruby-users at rubyforge.org > Subject: [fxruby-users] how to use FXCalendar widget > Message-ID: > <f1891ef1003230701j2937b17ch9bdb8cc4c2574c90 at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi everyone ! Can anybody explaine me in some lines how to use FXCalendar > component,please. > I tried as follows: > > [code] > require ''rubygems'' > require ''fox16'' > include Fox > > class Main < FXMainWindow > > def initialize(app) > super(app, "AGC - Excel file processing" , :width => 600, :height => > 400) > add_calendar > > end > > def add_calendar > FXCalendar.new(self) > end > > def create > super > show(PLACEMENT_SCREEN) > end > > if __FILE__ == $0 > FXApp.new do |app| > Main.new(app) > app.create > app.run > end > end > end > > [/code] > > and got the beloow exception: > [code] > C:/Documents and Settings/cambose/My > Documents/projects/excel_gui/lib/main.rb:14:in `add_calendar'': > uninitialized > constant Main::FXCalendar (NameError) > from C:/Documents and Settings/cambose/My > Documents/projects/excel_gui/lib/main.rb:9:in `initialize'' > from C:/Documents and Settings/cambose/My > Documents/projects/excel_gui/lib/main.rb:24:in `new'' > from C:/Documents and Settings/cambose/My > Documents/projects/excel_gui/lib/main.rb:24 > from > > C:/Ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/kwargs.rb:267:in > `old_initialize'' > from > > C:/Ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/kwargs.rb:267:in > `initialize'' > from C:/Documents and Settings/cambose/My > Documents/projects/excel_gui/lib/main.rb:23:in `new'' > from C:/Documents and Settings/cambose/My > Documents/projects/excel_gui/lib/main.rb:23 > [/code] > > Any idea how to do that ? Thanks > > -- > Sergue? CAMBOUR > +32-499-36.17.73 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://rubyforge.org/pipermail/fxruby-users/attachments/20100323/b63ddf01/attachment-0001.html > > > > ------------------------------ > > Message: 3 > Date: Tue, 23 Mar 2010 10:11:49 -0400 > From: Joey Kinsella <jkinsella at ancillaryservices.com> > To: fxruby-users at rubyforge.org > Subject: Re: [fxruby-users] how to use FXCalendar widget > Message-ID: > <39b4b9791003230711u6eb5e08cse87626d67bc7da30 at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > The code you posted worked fine for me as soon as I added: > > require ''fox16/calendar'' > > I am not sure why require ''fox16'' isn''t including the FXCalendar object. > Perhaps a bug? > > I hope this helps you, > --Joey > > On Tue, Mar 23, 2010 at 10:01 AM, Sergue? Cambour <s.cambour at gmail.com > >wrote: > > > Hi everyone ! Can anybody explaine me in some lines how to use FXCalendar > > component,please. > > I tried as follows: > > > > [code] > > require ''rubygems'' > > require ''fox16'' > > include Fox > > > > class Main < FXMainWindow > > > > def initialize(app) > > super(app, "AGC - Excel file processing" , :width => 600, :height => > > 400) > > add_calendar > > > > end > > > > def add_calendar > > FXCalendar.new(self) > > end > > > > def create > > super > > show(PLACEMENT_SCREEN) > > end > > > > if __FILE__ == $0 > > FXApp.new do |app| > > Main.new(app) > > app.create > > app.run > > end > > end > > end > > > > [/code] > > > > and got the beloow exception: > > [code] > > C:/Documents and Settings/cambose/My > > Documents/projects/excel_gui/lib/main.rb:14:in `add_calendar'': > uninitialized > > constant Main::FXCalendar (NameError) > > from C:/Documents and Settings/cambose/My > > Documents/projects/excel_gui/lib/main.rb:9:in `initialize'' > > from C:/Documents and Settings/cambose/My > > Documents/projects/excel_gui/lib/main.rb:24:in `new'' > > from C:/Documents and Settings/cambose/My > > Documents/projects/excel_gui/lib/main.rb:24 > > from > > > C:/Ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/kwargs.rb:267:in > > `old_initialize'' > > from > > > C:/Ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/kwargs.rb:267:in > > `initialize'' > > from C:/Documents and Settings/cambose/My > > Documents/projects/excel_gui/lib/main.rb:23:in `new'' > > from C:/Documents and Settings/cambose/My > > Documents/projects/excel_gui/lib/main.rb:23 > > [/code] > > > > Any idea how to do that ? Thanks > > > > -- > > Sergue? CAMBOUR > > +32-499-36.17.73 > > > > _______________________________________________ > > 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. > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://rubyforge.org/pipermail/fxruby-users/attachments/20100323/575da872/attachment-0001.html > > > > ------------------------------ > > Message: 4 > Date: Tue, 23 Mar 2010 10:12:24 -0400 > From: Paul Carvalho <tester.paul at gmail.com> > To: fxruby-users at rubyforge.org > Subject: Re: [fxruby-users] How do you enable a button for any option > change in UI? > Message-ID: > <37c405481003230712j1a2f7bcbrded3e543b946f021 at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > > > > Almost every widget that can be "clicked" sends a SEL_COMMAND message > > to its target whenever it gets clicked. This is true for basic > > buttons, but also for radio buttons, check buttons, etc. I would have > > assumed that you were already reacting to these messages anyways. But > > anyways, so, it''s not exactly that you''re iterating through all of the > > options constantly, but you''d just watch for when they change, e.g. > > > > @option1 = FXCheckButton.new(...) > > @option1.connect(SEL_COMMAND) do > > # the user clicked this check button to turn the option "on" or > > "off"... > > @config_changed = true > > end > > > > Ah, yes. I hadn''t gotten that far yet. I''m still working with the UI to > see if I can get it to do everything I need before I add the guts of the > functions. Thanks for the tip here. > > > > > > > >> > > >> That sounds like a good job for the registry (FXRegistry) service. > > > > Sure, take a look at the imageviewer.rb example program that comes > > with FXRuby. In the ImageWindow#onCmdQuit method you see examples of > > how to write application settings out to the registry; in > > ImageWindow#create, you see the opposite (reading those saved settings > > back into the application). > > > > That''s perfect. Thanks. > > I am now debating whether it''s worth the bother of having a separate [Save > Config] button or if I should just automatically save the options every > time > on exit like that example. > > BTW, do you know where these registry options are saved on a Windows box? > I > searched for a .foxrc file and in the registry but I couldn''t find them. > I''d like to have an idea of what the saved options look like to help me > figure out how to save/load them. > > Thanks! Paul. > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://rubyforge.org/pipermail/fxruby-users/attachments/20100323/4969a0ca/attachment-0001.html > > > > ------------------------------ > > Message: 5 > Date: Tue, 23 Mar 2010 10:19:18 -0400 > From: Paul Carvalho <tester.paul at gmail.com> > To: fxruby-users at rubyforge.org > Subject: Re: [fxruby-users] foxGUIb - how do you insert a title bar > icon? > Message-ID: > <37c405481003230719i1787f84age7338ca9cab9ed80 at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > On 23 March 2010 05:44, Meinrad Recheis wrote: > > > Hi Paul, > > Just, do it as you would do it with FXRuby using the instance of the > FXRuby > > mainwindow. IIRC a variable called @topwin is generated by foxguib where > you > > can access it. > > -- henon > > > > umm, I''m afraid I don''t understand this advice. > > I tried modifying the construct_widget_tree method to include a "w.icon" > property for the mainwindow, but it didn''t work. (I guessed, oh well.) I > tried adding "setIcon()" in the initialize and init methods but just got > different errors. > > Can you give an example in a line or two of how you can do this? > > Thanks. > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://rubyforge.org/pipermail/fxruby-users/attachments/20100323/d1f4ea7e/attachment-0001.html > > > > ------------------------------ > > Message: 6 > Date: Tue, 23 Mar 2010 10:08:41 -0500 > From: Lyle Johnson <lyle at lylejohnson.name> > To: fxruby-users at rubyforge.org > Subject: Re: [fxruby-users] How do you enable a button for any option > change in UI? > Message-ID: > <57cf8f721003230808l5a9c81e6q514188d65151af5d at mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > On Tue, Mar 23, 2010 at 9:12 AM, Paul Carvalho <tester.paul at gmail.com> > wrote: > > > I am now debating whether it''s worth the bother of having a separate > [Save > > Config] button or if I should just automatically save the options every > time > > on exit like that example. > > Personally, I think the latter option is preferable. > > > BTW, do you know where these registry options are saved on a Windows box? > > On Windows, they''re saved in the Windows registry itself (not to a > file). I know that it uses the application''s app name and vendor name > as parts of the registry key, but I think you''ll need to dig into the > FXRegistry class source code to get the specifics. > > > ------------------------------ > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > > End of fxruby-users Digest, Vol 66, Issue 12 > ******************************************** >-- Sergue? CAMBOUR +32-499-36.17.73 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20100323/4aaead8f/attachment-0001.html>