Created
January 22, 2010 21:42
-
-
Save anonymous/284158 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module LogoPanel | |
def setup_resources | |
img_file = File.join(File.dirname(__FILE__),"..","images","kirin","logo.png") | |
@logo_bitmap = Wx::Bitmap.new(img_file, Wx::BITMAP_TYPE_ANY) | |
self.evt_paint do |event| | |
self.paint do |dc| | |
dc.draw_bitmap(@logo_bitmap,0,0,false) | |
end | |
end | |
end | |
end | |
class GuiMain < XrcFrameMain | |
# Keys are: mb = menubar, tb = toolbar, fm = file menu | |
def initialize | |
super() | |
# paint our Gui | |
paint_gui_frames | |
# find events | |
register_event_handlers | |
end | |
end | |
def paint_gui_frames | |
# paint our main gui | |
img_file = File.join(File.dirname(__FILE__),"..","images","kirin","bg.png") | |
@main_gui_bitmap = Wx::Bitmap.new(img_file, Wx::BITMAP_TYPE_ANY) | |
self.evt_erase_background do |event| | |
self.paint do |dc| | |
dc.draw_bitmap(@main_gui_bitmap,0,0,false) | |
end | |
end | |
# paint our logo | |
@logo.setup_resources() | |
end | |
def register_event_handlers | |
# evt_button(Wx::ID_ANY) { 'some button was pressed' } | |
# File Menu - new workspace | |
evt_menu( @mb_fm_new, :on_new_workspace ) | |
# File Menu - save workspace | |
evt_menu( @mb_fm_save, :on_save_workspace ) | |
# File Menu - exit | |
evt_menu( @mb_fm_exit, :on_exit ) | |
# Process Status Bar Events text (3 frames so 0,1,2 are relevant array positions) | |
st_response("Idle...",2) | |
st_response(Time.now.strftime("%B %d, %Y"), 1) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment