summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-03-15 13:56:40 -0600
committerIra Rice <irarice@gmail.com>2009-03-15 13:56:40 -0600
commita9b1eccdd2c719f86475c6ce01d4b8eea7dede6c (patch)
tree75a8b557996feb095135a5cfbf74bdda69f77286
parent3123c8ce5f882f0bfb99a2d2efa45d760237ebcc (diff)
downloadmana-client-a9b1eccdd2c719f86475c6ce01d4b8eea7dede6c.tar.gz
mana-client-a9b1eccdd2c719f86475c6ce01d4b8eea7dede6c.tar.bz2
mana-client-a9b1eccdd2c719f86475c6ce01d4b8eea7dede6c.tar.xz
mana-client-a9b1eccdd2c719f86475c6ce01d4b8eea7dede6c.zip
Overrode the reset window function in the chat window to also reset the
position of the recorder, as well as fixed resetting the help window, and exposing the buy/sell window to being resettable, as well as remembering its previous position. All windows should now be covered by the reset button on the setup pane. Signed-off-by: Ira Rice <irarice@gmail.com>
-rw-r--r--src/gui/buysell.cpp5
-rw-r--r--src/gui/buysell.h2
-rw-r--r--src/gui/chat.cpp6
-rw-r--r--src/gui/chat.h6
-rw-r--r--src/gui/help.cpp13
-rw-r--r--src/gui/setup.cpp2
-rw-r--r--src/gui/window.h2
7 files changed, 27 insertions, 9 deletions
diff --git a/src/gui/buysell.cpp b/src/gui/buysell.cpp
index 2022b040..4ac06220 100644
--- a/src/gui/buysell.cpp
+++ b/src/gui/buysell.cpp
@@ -49,9 +49,10 @@ BuySellDialog::BuySellDialog(Network *network):
}
buyButton->requestFocus();
- setContentSize(x, 2 * y + buyButton->getHeight());
+ setDefaultSize(x + getPadding(), (2 * y + buyButton->getHeight() +
+ getTitleBarHeight()), ImageRect::CENTER);
- setLocationRelativeTo(ImageRect::CENTER);
+ loadWindowState();
requestFocus();
}
diff --git a/src/gui/buysell.h b/src/gui/buysell.h
index 747066a7..0842c0e1 100644
--- a/src/gui/buysell.h
+++ b/src/gui/buysell.h
@@ -54,4 +54,6 @@ class BuySellDialog : public Window, public gcn::ActionListener
Network *mNetwork;
};
+extern BuySellDialog *buySellDialog;
+
#endif
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index 44e08052..5ff9ed46 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -113,6 +113,12 @@ ChatWindow::~ChatWindow()
delete mParty;
}
+void ChatWindow::resetToDefaultSize()
+{
+ mRecorder->resetToDefaultSize();
+ Window::resetToDefaultSize();
+}
+
void ChatWindow::chatLog(std::string line, int own, bool ignoreRecord)
{
// Trim whitespace
diff --git a/src/gui/chat.h b/src/gui/chat.h
index 28408b93..8b710dc8 100644
--- a/src/gui/chat.h
+++ b/src/gui/chat.h
@@ -120,6 +120,12 @@ class ChatWindow : public Window, public gcn::ActionListener,
~ChatWindow();
/**
+ * Reset the chat window and recorder window attached to it to their
+ * default positions.
+ */
+ void resetToDefaultSize();
+
+ /**
* Adds a line of text to our message list. Parameters:
*
* @param line Text message.
diff --git a/src/gui/help.cpp b/src/gui/help.cpp
index fec39199..0974abf7 100644
--- a/src/gui/help.cpp
+++ b/src/gui/help.cpp
@@ -40,16 +40,17 @@ HelpWindow::HelpWindow():
setWindowName(_("Help"));
setResizable(true);
+ setDefaultSize(500, 400, ImageRect::CENTER);
+
mBrowserBox = new BrowserBox();
mBrowserBox->setOpaque(false);
mScrollArea = new ScrollArea(mBrowserBox);
Button *okButton = new Button(_("Close"), "close", this);
- mScrollArea->setDimension(gcn::Rectangle(
- 5, 5, 445, 335 - okButton->getHeight()));
- okButton->setPosition(
- 450 - okButton->getWidth(),
- 345 - okButton->getHeight());
+ mScrollArea->setDimension(gcn::Rectangle(5, 5, 445,
+ 335 - okButton->getHeight()));
+ okButton->setPosition(450 - okButton->getWidth(),
+ 345 - okButton->getHeight());
mBrowserBox->setLinkHandler(this);
@@ -59,7 +60,7 @@ HelpWindow::HelpWindow():
Layout &layout = getLayout();
layout.setRowHeight(0, Layout::AUTO_SET);
- setLocationRelativeTo(getParent());
+ loadWindowState();
}
void HelpWindow::action(const gcn::ActionEvent &event)
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp
index dc232296..ca6b4010 100644
--- a/src/gui/setup.cpp
+++ b/src/gui/setup.cpp
@@ -38,6 +38,7 @@ extern Window *chatWindow;
extern Window *statusWindow;
extern Window *buyDialog;
extern Window *sellDialog;
+extern Window *buySellDialog;
extern Window *inventoryWindow;
extern Window *emoteWindow;
extern Window *npcTextDialog;
@@ -140,6 +141,7 @@ void Setup::action(const gcn::ActionEvent &event)
statusWindow->resetToDefaultSize();
buyDialog->resetToDefaultSize();
sellDialog->resetToDefaultSize();
+ buySellDialog->resetToDefaultSize();
inventoryWindow->resetToDefaultSize();
emoteWindow->resetToDefaultSize();
npcTextDialog->resetToDefaultSize();
diff --git a/src/gui/window.h b/src/gui/window.h
index e04fcfc3..518e1ec2 100644
--- a/src/gui/window.h
+++ b/src/gui/window.h
@@ -266,7 +266,7 @@ class Window : public gcn::Window, gcn::WidgetListener
* Reset the win pos and size to default. Don't forget to set defaults
* first.
*/
- void resetToDefaultSize();
+ virtual void resetToDefaultSize();
/**
* Gets the layout handler for this window.