noreply at rubyforge.org
2008-Jan-11 06:00 UTC
[wxruby-development] [ wxruby-Bugs-17013 ] Notebook#get_current_page
Bugs item #17013, was opened at 2008-01-11 06:00 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=218&aid=17013&group_id=35 Category: Missing API call Group: None Status: Open Resolution: None Priority: 3 Submitted By: Daniel Brumbaugh Keeney (db-keen) Assigned to: Nobody (None) Summary: Notebook#get_current_page Initial Comment: Notebook#get_current_page is not defined http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebook http://wxruby.rubyforge.org/doc/notebook.html#Notebook_getcurrentpage I''m not sure, but I think at least one part of the code that needs to be changed is that this line: int GetCurrentPage() const should be added to wxruby-1.9.2/swig/classes/include/wxNotebook.h ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=218&aid=17013&group_id=35
Mario Steele
2008-Jan-11 12:35 UTC
[wxruby-development] [ wxruby-Bugs-17013 ] Notebook#get_current_page
I have already added the GetCurrentPage() API Call to swig/classes/include/wxNotebook.h, and am testing it to see if everything will work as expected. If it looks good, I''ll update the SVN with it. Also, I am almost finished with the GraphicsContext demo, making it do some spinning of text, randomly bounding text around, and randomly drawing lines on the device context so that people can see how it works in more details. L8ers, Mario Steele On 1/11/08, noreply at rubyforge.org <noreply at rubyforge.org> wrote:> > Bugs item #17013, was opened at 2008-01-11 06:00 > You can respond by visiting: > http://rubyforge.org/tracker/?func=detail&atid=218&aid=17013&group_id=35 > > Category: Missing API call > Group: None > Status: Open > Resolution: None > Priority: 3 > Submitted By: Daniel Brumbaugh Keeney (db-keen) > Assigned to: Nobody (None) > Summary: Notebook#get_current_page > > Initial Comment: > Notebook#get_current_page is not defined > > http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebook > http://wxruby.rubyforge.org/doc/notebook.html#Notebook_getcurrentpage > > I''m not sure, but I think at least one part of the code that needs to be > changed is that this line: > > int GetCurrentPage() const > > should be added to wxruby-1.9.2/swig/classes/include/wxNotebook.h > > ---------------------------------------------------------------------- > > You can respond by visiting: > http://rubyforge.org/tracker/?func=detail&atid=218&aid=17013&group_id=35 > _______________________________________________ > wxruby-development mailing list > wxruby-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-development >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-development/attachments/20080111/9ff7025a/attachment.html
Alex Fenton
2008-Jan-11 12:42 UTC
[wxruby-development] [ wxruby-Bugs-17013 ] Notebook#get_current_page
Mario I doubt that get_current_page will work out the box - you''ll need to do something similar to the wrapping for get_grand_parent and other methods in swig/classes/Window.i. You''ll need to "include ''shared/get_ruby_window.i''" Otherwise if a Notebook is loaded from XRC or something, the wrong class of object will be returned (a Wx::Window - rather than the appropriate subclass eg Wx::Panel). Good work on the GraphicsContext example. It''d be nice to show the image transforms as that''s another cool feature of GCD, but we can add that later. And I don''t really understand GraphicsMatrix ... cheers alex Mario Steele wrote:> I have already added the GetCurrentPage() API Call to > swig/classes/include/wxNotebook.h, and am testing it to see if > everything will work as expected. If it looks good, I''ll update the > SVN with it. Also, I am almost finished with the GraphicsContext > demo, making it do some spinning of text, randomly bounding text > around, and randomly drawing lines on the device context so that > people can see how it works in more details. > > L8ers, > > Mario Steele > > On 1/11/08, *noreply at rubyforge.org <mailto:noreply at rubyforge.org>* < > noreply at rubyforge.org <mailto:noreply at rubyforge.org>> wrote: > > Bugs item #17013, was opened at 2008-01-11 06:00 > You can respond by visiting: > http://rubyforge.org/tracker/?func=detail&atid=218&aid=17013&group_id=35 > <http://rubyforge.org/tracker/?func=detail&atid=218&aid=17013&group_id=35> > > Category: Missing API call > Group: None > Status: Open > Resolution: None > Priority: 3 > Submitted By: Daniel Brumbaugh Keeney (db-keen) > Assigned to: Nobody (None) > Summary: Notebook#get_current_page > > Initial Comment: > Notebook#get_current_page is not defined > > http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebook > http://wxruby.rubyforge.org/doc/notebook.html#Notebook_getcurrentpage > > I''m not sure, but I think at least one part of the code that needs > to be changed is that this line: > > int GetCurrentPage() const > > should be added to wxruby-1.9.2/swig/classes/include/wxNotebook.h > > ---------------------------------------------------------------------- > > You can respond by visiting: > http://rubyforge.org/tracker/?func=detail&atid=218&aid=17013&group_id=35 > <http://rubyforge.org/tracker/?func=detail&atid=218&aid=17013&group_id=35> > _______________________________________________ > wxruby-development mailing list > wxruby-development at rubyforge.org > <mailto:wxruby-development at rubyforge.org> > http://rubyforge.org/mailman/listinfo/wxruby-development > > > ------------------------------------------------------------------------ > > _______________________________________________ > wxruby-development mailing list > wxruby-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-development >
Mario Steele
2008-Jan-11 12:54 UTC
[wxruby-development] [ wxruby-Bugs-17013 ] Notebook#get_current_page
I''ll try it and see if it''ll work without using the swig/classes/Window.i, and include ''shared/get_ruby_window.i''. From what I can tell of wxNotebook::GetCurrentPage() API, it only returns the index of the Current Page being displayed. This is different in wxNotebook::GetCurrentSelection() as, it doesn''t wait for the user to select a page, before returning what page is currently being displayed. I guess, in other words, ::GetCurrentSelection() needs to have a page Selected first, otherwise it''ll return NULL (or nil in our case), where as ::GetCurrentPage() will always return the page currently being displayed, whether a page has been Programed to display or not. Plus, this method has been documented in the docs for quite some time, and hasn''t actually been placed into effect, so I''m just basically tidying up, to match our API with what we have documented. Thanks, I think the demo will be pretty interesting, as it''ll have so much activity going on, that people are going to look at it kinda funny. lol L8ers, Mario Steele On 1/11/08, Alex Fenton <alex at pressure.to> wrote:> > Mario > > I doubt that get_current_page will work out the box - you''ll need to do > something similar to the wrapping for get_grand_parent and other methods > in swig/classes/Window.i. You''ll need to "include > ''shared/get_ruby_window.i''" > > Otherwise if a Notebook is loaded from XRC or something, the wrong class > of object will be returned (a Wx::Window - rather than the appropriate > subclass eg Wx::Panel). > > Good work on the GraphicsContext example. It''d be nice to show the image > transforms as that''s another cool feature of GCD, but we can add that > later. And I don''t really understand GraphicsMatrix ... > > cheers > alex > > Mario Steele wrote: > > I have already added the GetCurrentPage() API Call to > > swig/classes/include/wxNotebook.h, and am testing it to see if > > everything will work as expected. If it looks good, I''ll update the > > SVN with it. Also, I am almost finished with the GraphicsContext > > demo, making it do some spinning of text, randomly bounding text > > around, and randomly drawing lines on the device context so that > > people can see how it works in more details. > > > > L8ers, > > > > Mario Steele > > > > On 1/11/08, *noreply at rubyforge.org <mailto:noreply at rubyforge.org>* < > > noreply at rubyforge.org <mailto:noreply at rubyforge.org>> wrote: > > > > Bugs item #17013, was opened at 2008-01-11 06:00 > > You can respond by visiting: > > > http://rubyforge.org/tracker/?func=detail&atid=218&aid=17013&group_id=35 > > < > http://rubyforge.org/tracker/?func=detail&atid=218&aid=17013&group_id=35> > > > > Category: Missing API call > > Group: None > > Status: Open > > Resolution: None > > Priority: 3 > > Submitted By: Daniel Brumbaugh Keeney (db-keen) > > Assigned to: Nobody (None) > > Summary: Notebook#get_current_page > > > > Initial Comment: > > Notebook#get_current_page is not defined > > > > > http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebook > > > http://wxruby.rubyforge.org/doc/notebook.html#Notebook_getcurrentpage > > > > I''m not sure, but I think at least one part of the code that needs > > to be changed is that this line: > > > > int GetCurrentPage() const > > > > should be added to wxruby-1.9.2/swig/classes/include/wxNotebook.h > > > > > ---------------------------------------------------------------------- > > > > You can respond by visiting: > > > http://rubyforge.org/tracker/?func=detail&atid=218&aid=17013&group_id=35 > > < > http://rubyforge.org/tracker/?func=detail&atid=218&aid=17013&group_id=35> > > _______________________________________________ > > wxruby-development mailing list > > wxruby-development at rubyforge.org > > <mailto:wxruby-development at rubyforge.org> > > http://rubyforge.org/mailman/listinfo/wxruby-development > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > wxruby-development mailing list > > wxruby-development at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wxruby-development > > > > _______________________________________________ > wxruby-development mailing list > wxruby-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-development >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-development/attachments/20080111/33a03e29/attachment-0001.html
Alex Fenton
2008-Jan-11 12:57 UTC
[wxruby-development] [ wxruby-Bugs-17013 ] Notebook#get_current_page
Mario Steele wrote:> I''ll try it and see if it''ll work without using the > swig/classes/Window.i, and include ''shared/get_ruby_window.i''. From > what I can tell of wxNotebook::GetCurrentPage() API, it only returns > the index of the Current Page being displayed.I''m not sure - in both the wxWidgets and wxRuby docs it''s documented as returning wxWindow* or NULL. In which case it will need to use get_ruby_window etc. If you want to leave it I can do it this evening. cheers alex
Mario Steele
2008-Jan-11 13:02 UTC
[wxruby-development] [ wxruby-Bugs-17013 ] Notebook#get_current_page
Okay, I mis-read it myself. Anyways, looking at the generated code, and such, I actually find, that wxNotebook::GetPage() is already wrapped, which means it should already have the stuff needed for GetCurrentPage() to work and return the correct casting. I just need to correct it in wxNotebook.hto return a wxWindow instead of a int. L8ers, Mario Steele On 1/11/08, Alex Fenton <alex at pressure.to> wrote:> > Mario Steele wrote: > > I''ll try it and see if it''ll work without using the > > swig/classes/Window.i, and include ''shared/get_ruby_window.i''. From > > what I can tell of wxNotebook::GetCurrentPage() API, it only returns > > the index of the Current Page being displayed. > I''m not sure - in both the wxWidgets and wxRuby docs it''s documented as > returning wxWindow* or NULL. In which case it will need to use > get_ruby_window etc. If you want to leave it I can do it this evening. > > cheers > alex > _______________________________________________ > wxruby-development mailing list > wxruby-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-development >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-development/attachments/20080111/f2766c5c/attachment.html
Mario Steele
2008-Jan-11 13:05 UTC
[wxruby-development] [ wxruby-Bugs-17013 ] Notebook#get_current_page
Yeah, I need to read more, before I start throwing stuff out. I see the difference. GetPage() returns wxNotebookPage, not wxWindow. I''ll look into the code you provided, and try compiling it here in a bit. L8ers, Mario Steele On 1/11/08, Mario Steele <mario at ruby-im.net> wrote:> > Okay, I mis-read it myself. Anyways, looking at the generated code, and > such, I actually find, that wxNotebook::GetPage() is already wrapped, which > means it should already have the stuff needed for GetCurrentPage() to work > and return the correct casting. I just need to correct it in wxNotebook.hto return a wxWindow instead of a int. > > L8ers, > > Mario Steele > > On 1/11/08, Alex Fenton <alex at pressure.to > wrote: > > > > Mario Steele wrote: > > > I''ll try it and see if it''ll work without using the > > > swig/classes/Window.i, and include ''shared/get_ruby_window.i''. From > > > what I can tell of wxNotebook::GetCurrentPage() API, it only returns > > > the index of the Current Page being displayed. > > I''m not sure - in both the wxWidgets and wxRuby docs it''s documented as > > returning wxWindow* or NULL. In which case it will need to use > > get_ruby_window etc. If you want to leave it I can do it this evening. > > > > cheers > > alex > > _______________________________________________ > > wxruby-development mailing list > > wxruby-development at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wxruby-development > > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-development/attachments/20080111/3d383f2b/attachment.html
Alex Fenton
2008-Jan-11 13:14 UTC
[wxruby-development] [ wxruby-Bugs-17013 ] Notebook#get_current_page
wxNotebookPage is a wxWidgets internal class name, which in wxRuby is aliased to its correct (basic) return type, Window. That''s in Notebook.i. However I think get_page probably currently won''t work correctly for Notebooks loaded from XRC, for the same reasons (it shouldn''t return an actual Ruby instance of Wx::Window, but some specific window subclass). What get_ruby_window.i does is interface with wxWidgets'' run-time class information system to map a C++ class to the right ruby class I''ll see if you''re on IRC .... a Mario Steele wrote:> Yeah, I need to read more, before I start throwing stuff out. I see > the difference. GetPage() returns wxNotebookPage, not wxWindow. I''ll > look into the code you provided, and try compiling it here in a bit. > > L8ers, > > Mario Steele > > On 1/11/08, *Mario Steele* <mario at ruby-im.net > <mailto:mario at ruby-im.net>> wrote: > > Okay, I mis-read it myself. Anyways, looking at the generated > code, and such, I actually find, that wxNotebook::GetPage() is > already wrapped, which means it should already have the stuff > needed for GetCurrentPage() to work and return the correct > casting. I just need to correct it in wxNotebook.h to return a > wxWindow instead of a int. > > L8ers, > > Mario Steele > > On 1/11/08, *Alex Fenton* < alex at pressure.to > <mailto:alex at pressure.to>> wrote: > > Mario Steele wrote: > > I''ll try it and see if it''ll work without using the > > swig/classes/Window.i, and include > ''shared/get_ruby_window.i''. From > > what I can tell of wxNotebook::GetCurrentPage() API, it only > returns > > the index of the Current Page being displayed. > I''m not sure - in both the wxWidgets and wxRuby docs it''s > documented as > returning wxWindow* or NULL. In which case it will need to use > get_ruby_window etc. If you want to leave it I can do it this > evening. > > cheers > alex > _______________________________________________ > wxruby-development mailing list > wxruby-development at rubyforge.org > <mailto:wxruby-development at rubyforge.org> > http://rubyforge.org/mailman/listinfo/wxruby-development > > > > ------------------------------------------------------------------------ > > _______________________________________________ > wxruby-development mailing list > wxruby-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-development >
Mario Steele
2008-Jan-11 15:52 UTC
[wxruby-development] [ wxruby-Bugs-17013 ] Notebook#get_current_page
Alex, I didn''t mess with the problems we discussed about GraphicsContext, and the Notebook#get_current_page. Though, I did look over the code in typemap.i, and I think this would be the best solution for our GraphicsContext#get_text_extent() %apply double *OUTPUT { wxDouble * w, wxDouble * h, wxDouble * descent, wxDouble * externalLeading } %typemap(directorargout) ( wxDouble * w, wxDouble * h, wxDouble * descent, wxDouble * externalLeading) { if((TYPE(result) == T_ARRAY) && (RARRAY(result)->len >= 2)) { *$1 = ($*1_ltype)NUM2INT(rb_ary_entry(result,0)); *$2 = ($*2_ltype)NUM2INT(rb_ary_entry(result,1)); if(($3 != NULL) && RARRAY(result)->len >= 3) *$3 = ($*3_ltype)NUM2INT(rb_ary_entry(result,2)); if(($4 != NULL) && RARRAY(result)->len >= 4) *$4 = ($*4_ltype)NUM2INT(rb_ary_entry(result,3)); } } Seeing that this is pretty much just a duplicate of the already existing int version. Dunno how well that would actually work, but figure I''d give you the code, and let you patch it. I will talk with you later. L8ers, Mario Steele On 1/11/08, Alex Fenton <alex at pressure.to> wrote:> > wxNotebookPage is a wxWidgets internal class name, which in wxRuby is > aliased to its correct (basic) return type, Window. That''s in Notebook.i. > > However I think get_page probably currently won''t work correctly for > Notebooks loaded from XRC, for the same reasons (it shouldn''t return an > actual Ruby instance of Wx::Window, but some specific window subclass). > What get_ruby_window.i does is interface with wxWidgets'' run-time class > information system to map a C++ class to the right ruby class > > I''ll see if you''re on IRC .... > > a > > > > Mario Steele wrote: > > Yeah, I need to read more, before I start throwing stuff out. I see > > the difference. GetPage() returns wxNotebookPage, not wxWindow. I''ll > > look into the code you provided, and try compiling it here in a bit. > > > > L8ers, > > > > Mario Steele > > > > On 1/11/08, *Mario Steele* <mario at ruby-im.net > > <mailto:mario at ruby-im.net>> wrote: > > > > Okay, I mis-read it myself. Anyways, looking at the generated > > code, and such, I actually find, that wxNotebook::GetPage() is > > already wrapped, which means it should already have the stuff > > needed for GetCurrentPage() to work and return the correct > > casting. I just need to correct it in wxNotebook.h to return a > > wxWindow instead of a int. > > > > L8ers, > > > > Mario Steele > > > > On 1/11/08, *Alex Fenton* < alex at pressure.to > > <mailto:alex at pressure.to>> wrote: > > > > Mario Steele wrote: > > > I''ll try it and see if it''ll work without using the > > > swig/classes/Window.i, and include > > ''shared/get_ruby_window.i''. From > > > what I can tell of wxNotebook::GetCurrentPage() API, it only > > returns > > > the index of the Current Page being displayed. > > I''m not sure - in both the wxWidgets and wxRuby docs it''s > > documented as > > returning wxWindow* or NULL. In which case it will need to use > > get_ruby_window etc. If you want to leave it I can do it this > > evening. > > > > cheers > > alex > > _______________________________________________ > > wxruby-development mailing list > > wxruby-development at rubyforge.org > > <mailto:wxruby-development at rubyforge.org> > > http://rubyforge.org/mailman/listinfo/wxruby-development > > > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > wxruby-development mailing list > > wxruby-development at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wxruby-development > > > > _______________________________________________ > wxruby-development mailing list > wxruby-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-development >-- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ http://rubyforge.org/projects/vwmc/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-development/attachments/20080111/fa15a4ed/attachment-0001.html
Alex Fenton
2008-Jan-11 21:31 UTC
[wxruby-development] [ wxruby-Bugs-17013 ] Notebook#get_current_page
Mario Steele wrote:> Alex, > > I didn''t mess with the problems we discussed about GraphicsContext, > and the Notebook#get_current_page. Though, I did look over the code > in typemap.i, and I think this would be the best solution for our > GraphicsContext#get_text_extent()Thanks, applied, with some slight fixes to the parameter names alex