diff --git a/lib/tailor/GUI/GridPropertiesWidget.rb b/lib/tailor/GUI/GridPropertiesWidget.rb deleted file mode 100644 index f104b4d..0000000 --- a/lib/tailor/GUI/GridPropertiesWidget.rb +++ /dev/null @@ -1,11 +0,0 @@ -require 'wx' - -module Tailor - module GUI - class GridPropertiesWidget < Wx::Frame - def initialize() - super(nil, -1) - end - end - end -end diff --git a/lib/tailor/GUI/MainWindow.rb b/lib/tailor/GUI/MainWindow.rb index 46eb8ae..889dfdc 100644 --- a/lib/tailor/GUI/MainWindow.rb +++ b/lib/tailor/GUI/MainWindow.rb @@ -1,12 +1,18 @@ require 'wx' require 'Tailor/version' +require 'Tailor/GUI/TilesetProperties' module Tailor module GUI class MainWindow < Wx::Frame def initialize() super(nil, -1, 'Tailor') - @mainPanel = Wx::Panel.new(self) + init_menubar() + init_mainpanel() + show() + end + + def init_menubar @menuBar = Wx::MenuBar.new menuFile = Wx::Menu.new 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(Wx::ID_EXIT, :on_file_exit) 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 def on_file_new + @tilesetProperties = Tailor::GUI::TilesetProperties.new(@mainPanelSizer, Wx::ID_ANY) end def on_file_open diff --git a/lib/tailor/GUI/TilesetProperties.rb b/lib/tailor/GUI/TilesetProperties.rb new file mode 100644 index 0000000..75e34e1 --- /dev/null +++ b/lib/tailor/GUI/TilesetProperties.rb @@ -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