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 | |
| 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')
| -rw-r--r-- | src/ui/dialog/find.cpp | 78 | ||||
| -rw-r--r-- | src/ui/dialog/find.h | 11 |
2 files changed, 83 insertions, 6 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 +} diff --git a/src/ui/dialog/find.h b/src/ui/dialog/find.h index d969236b8..64068a862 100644 --- a/src/ui/dialog/find.h +++ b/src/ui/dialog/find.h @@ -12,12 +12,12 @@ #ifndef INKSCAPE_UI_DIALOG_FIND_H #define INKSCAPE_UI_DIALOG_FIND_H -#include <gtkmm/notebook.h> #include <glibmm/i18n.h> #include "dialog.h" #include "ui/widget/button.h" #include "ui/widget/entry.h" +#include <gtkmm/separator.h> #include "message-stack.h" #include "helper/window.h" @@ -88,11 +88,13 @@ protected: CheckButton _check_groups; CheckButton _check_clones; CheckButton _check_images; - CheckButton _check_offsets; + CheckButton _check_offsets; // Button-click handlers void onClear(); - void onFind(); + void onFind(); + void onToggleAlltypes(); + void onToggleShapes(); // onFind helper functions @@ -106,7 +108,8 @@ protected: GSList * filter_list (GSList *l, bool exact); GSList * all_items (SPObject *r, GSList *l, bool hidden, bool locked); GSList * all_selection_items (Inkscape::Selection *s, GSList *l, SPObject *ancestor, bool hidden, bool locked); - + + void squeeze_window(); private: Find(Find const &d); |
