diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2006-11-29 21:33:35 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2006-11-29 21:33:35 +0000 |
| commit | b7e359f0563eda09785f024f9e253ae3eff3c972 (patch) | |
| tree | 38f62321450d0daad38b89a978a09bff6cfa6ba3 /src/ui/dialog/find.cpp | |
| parent | C++ Find dialog almost complete! (it works, but it is biiig now) (diff) | |
| download | inkscape-b7e359f0563eda09785f024f9e253ae3eff3c972.tar.gz inkscape-b7e359f0563eda09785f024f9e253ae3eff3c972.zip | |
C++ find dialog: only UI issues left (i hope) Testing needed.
(bzr r2055)
Diffstat (limited to 'src/ui/dialog/find.cpp')
| -rw-r--r-- | src/ui/dialog/find.cpp | 78 |
1 files changed, 76 insertions, 2 deletions
diff --git a/src/ui/dialog/find.cpp b/src/ui/dialog/find.cpp index 42f09e998..4098c4aae 100644 --- a/src/ui/dialog/find.cpp +++ b/src/ui/dialog/find.cpp @@ -14,6 +14,7 @@ # include <config.h> #endif +#include <gtkmm/widget.h> #include "find.h" #include "verbs.h" @@ -111,14 +112,18 @@ Find::Find() vbox->pack_start(_button_clear, true, true); vbox->pack_start(_button_find, true, true); + // set signals to handle clicks + _check_all.signal_clicked().connect(sigc::mem_fun(*this, &Find::onToggleAlltypes)); + _check_all_shapes.signal_clicked().connect(sigc::mem_fun(*this, &Find::onToggleShapes)); _button_clear.signal_clicked().connect(sigc::mem_fun(*this, &Find::onClear)); _button_find.signal_clicked().connect(sigc::mem_fun(*this, &Find::onFind)); + _button_find.set_flags(Gtk::CAN_DEFAULT); set_default (_button_find); // activatable by Enter - - + _entry_text.getEntry()->grab_focus(); show_all_children(); + onClear(); } Find::~Find() @@ -440,6 +445,75 @@ Find::onFind() } } +void +Find::onToggleAlltypes () +{ + if (_check_all.get_active()) { + // explicit toggle to make sure its handler gets called, no matter what was the original state + _check_all_shapes.toggled(); + _check_all_shapes.set_active(); + _check_all_shapes.hide(); + _check_paths.hide(); + _check_texts.hide(); + _check_groups.hide(); + _check_clones.hide(); + _check_images.hide(); + _check_offsets.hide(); + } else { + // explicit toggle to make sure its handler gets called, no matter what was the original state + _check_all_shapes.toggled(); + _check_all_shapes.set_active(); + _check_all_shapes.show(); + + _check_paths.set_active(); + _check_paths.show(); + _check_texts.set_active(); + _check_texts.show(); + _check_groups.set_active(); + _check_groups.show(); + _check_clones.set_active(); + _check_clones.show(); + _check_images.set_active(); + _check_images.show(); + _check_offsets.set_active(); + _check_offsets.show(); + } + squeeze_window(); +} + +void +Find::onToggleShapes () +{ + if (_check_all_shapes.get_active()) { + _check_rects.hide(); + _check_ellipses.hide(); + _check_stars.hide(); + _check_spirals.hide(); + } else { + _check_rects.set_active(); + _check_rects.show(); + _check_ellipses.set_active(); + _check_ellipses.show(); + _check_stars.set_active(); + _check_stars.show(); + _check_spirals.set_active(); + _check_spirals.show(); + } + squeeze_window(); +} + + +/*######################################################################## +# UTILITY +########################################################################*/ + + + +void +Find::squeeze_window() +{ + // TO DO: make window as small as possible +} |
