added resizehorizontal and resizevertical, patch from Mathias Gumz

This commit is contained in:
fluxgen 2003-08-19 23:37:31 +00:00
parent 6d1ac53b5f
commit 5749014fa7
3 changed files with 35 additions and 4 deletions

View file

@ -20,7 +20,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// $Id: CurrentWindowCmd.cc,v 1.3 2003/07/28 15:06:33 rathnor Exp $
// $Id: CurrentWindowCmd.cc,v 1.4 2003/08/19 23:37:31 fluxgen Exp $
#include "CurrentWindowCmd.hh"
@ -85,3 +85,13 @@ void MoveUpCmd::real_execute() {
fbwindow().move(fbwindow().x(), fbwindow().y() - stepSize());
}
ResizeHorizontalCmd::ResizeHorizontalCmd(int step_size):MoveHelper(step_size) { }
void ResizeHorizontalCmd::real_execute() {
fbwindow().resize(fbwindow().width() + stepSize() * fbwindow().winClient().width_inc, fbwindow().height());
}
ResizeVerticalCmd::ResizeVerticalCmd(int step_size):MoveHelper(step_size) { }
void ResizeVerticalCmd::real_execute() {
fbwindow().resize(fbwindow().width(), fbwindow().height() + stepSize() * fbwindow().winClient().height_inc);
}

View file

@ -20,7 +20,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// $Id: CurrentWindowCmd.hh,v 1.2 2003/07/28 15:06:33 rathnor Exp $
// $Id: CurrentWindowCmd.hh,v 1.3 2003/08/19 23:37:31 fluxgen Exp $
#ifndef CURRENTWINDOWCMD_HH
#define CURRENTWINDOWCMD_HH
@ -110,4 +110,19 @@ protected:
void real_execute();
};
// resize vertical
class ResizeVerticalCmd: public MoveHelper {
public:
explicit ResizeVerticalCmd(int step_size);
protected:
void real_execute();
};
// resize horizontal
class ResizeHorizontalCmd: public MoveHelper{
public:
explicit ResizeHorizontalCmd(int step_size);
protected:
void real_execute();
};
#endif // CURRENTWINDOWCMD_HH

View file

@ -20,7 +20,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// $Id: FbCommandFactory.cc,v 1.11 2003/07/28 12:05:27 fluxgen Exp $
// $Id: FbCommandFactory.cc,v 1.12 2003/08/19 23:37:31 fluxgen Exp $
#include "FbCommandFactory.hh"
@ -38,7 +38,7 @@ FbCommandFactory FbCommandFactory::s_autoreg;
FbCommandFactory::FbCommandFactory() {
// setup commands that we can handle
const char commands[][30] = {
const char commands[][32] = {
"setstyle",
"saverc",
"reconfigure",
@ -54,6 +54,8 @@ FbCommandFactory::FbCommandFactory() {
"maximize",
"maximizevertical",
"maximizehorizontal",
"resizevertical",
"resizehorizontal",
"moveright",
"moveleft",
"moveup",
@ -125,6 +127,10 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command,
return new CurrentWindowCmd(&FluxboxWindow::maximizeVertical);
else if (command == "maximizehorizontal")
return new CurrentWindowCmd(&FluxboxWindow::maximizeHorizontal);
else if (command == "resizehorizontal")
return new ResizeHorizontalCmd(atoi(arguments.c_str()));
else if (command == "resizevertical")
return new ResizeVerticalCmd(atoi(arguments.c_str()));
else if (command == "moveright")
return new MoveRightCmd(atoi(arguments.c_str()));
else if (command == "moveleft")