Midstream

This commit is contained in:
2014-05-06 22:24:45 -07:00
parent 781512176e
commit 3feee8cb8e
3 changed files with 44 additions and 13 deletions

View File

@@ -1,11 +0,0 @@
require 'wx'
module Tailor
module GUI
class GridPropertiesWidget < Wx::Frame
def initialize()
super(nil, -1)
end
end
end
end

View File

@@ -1,12 +1,18 @@
require 'wx' require 'wx'
require 'Tailor/version' require 'Tailor/version'
require 'Tailor/GUI/TilesetProperties'
module Tailor module Tailor
module GUI module GUI
class MainWindow < Wx::Frame class MainWindow < Wx::Frame
def initialize() def initialize()
super(nil, -1, 'Tailor') super(nil, -1, 'Tailor')
@mainPanel = Wx::Panel.new(self) init_menubar()
init_mainpanel()
show()
end
def init_menubar
@menuBar = Wx::MenuBar.new @menuBar = Wx::MenuBar.new
menuFile = Wx::Menu.new menuFile = Wx::Menu.new
menuFileNew = menuFile.append(Wx::ID_ANY, "&New\tAlt-N", "New Compilation") menuFileNew = menuFile.append(Wx::ID_ANY, "&New\tAlt-N", "New Compilation")
@@ -30,10 +36,15 @@ module Tailor
evt_menu(menuFileClose, :on_file_close) evt_menu(menuFileClose, :on_file_close)
evt_menu(Wx::ID_EXIT, :on_file_exit) evt_menu(Wx::ID_EXIT, :on_file_exit)
evt_menu(Wx::ID_ABOUT, :on_help_about) evt_menu(Wx::ID_ABOUT, :on_help_about)
show() end
def init_mainpanel
@mainPanel = Wx::Panel.new(self)
@mainPanelSizer = Wx::BoxSizer.new(Wx::HORIZONTAL)
end end
def on_file_new def on_file_new
@tilesetProperties = Tailor::GUI::TilesetProperties.new(@mainPanelSizer, Wx::ID_ANY)
end end
def on_file_open def on_file_open

View File

@@ -0,0 +1,31 @@
require 'wx'
module Tailor
module GUI
class TilesetProperties < Wx::Panel
def initialize(parent = nil,
id = Wx::ID_ANY,
pos = Wx::DEFAULT_POSITION,
size = Wx::DEFAULT_SIZE,
style = Wx::TAB_TRAVERSAL,
name = "TilesetProperties")
super(parent, id, pos, size, style, name)
values = {
"Tile X" => 32,
"Tile Y" => 32,
"Pad X" => 0,
"Pad Y" => 0,
"Space X" => 0,
"Space Y" => 0
}
@sizer = Wx::BoxSizer.new(Wx::VERTICAL)
values.each_pair do |elem, value|
tmpsizer = Wx::BoxSizer.new(Wx::HORIZONTAL)
Wx::StaticText.new(tmpsizer, Wx::ID_ANY, elem)
self.send(elem.gsub(/ /, ''), Wx::TextCtrl.new(tmpsizer, Wx::ID_ANY, value.to_s))
@sizer.add(tmpsizer)
end
end
end
end
end