Commit 265bc816 authored by Murray Cumming's avatar Murray Cumming Committed by Murray Cumming

Updated for latest API. Added gtk/gtkmm/comboboxtext.[h|cc], putting

2003-10-17  Murray Cumming  <murrayc@usa.net>

        * gtk/src/combobox.hg: Updated for latest API.
        * Added gtk/gtkmm/comboboxtext.[h|cc], putting text-based stuff
        in a sub class.
        * gtk/src/treemodel.[hg|ccg]: Added const overload of children(),
        but it's a bad hack that needs more attention.
        * Added examples/book/combobox, which uses ComboBoxText and should use
        ComboBox also in future. It segfaults at the moment.
        * Added gtk/src/toggleaction.[hg|ccg] and gtk/src/radioaction.hg.
        * Wrapped GList* and GSList*-using methods.
        * UIManager: Wrapped Error-using methods, with optional errthrow
          parameter of _WRAP_METHOD().
        * gtk/src/gtk_signals.defs: Updated with newly-generated defs from
        extra_defs_gen, redoing the by-hand corrections.
        * examples/book/dialogs/colorselection, fontselection: Used
        the buttons instead. This will be moved into the buttons folder
        later.
        * examples/book/dialogs/messagedialog: Updated for new constructor
        API.
parent 55b49444
......@@ -7,8 +7,17 @@
but it's a bad hack that needs more attention.
* Added examples/book/combobox, which uses ComboBoxText and should use
ComboBox also in future. It segfaults at the moment.
* Added gtk/src/toggleaction.[hg|ccg] and gtk/src/radioaction.hg.
* Wrapped GList* and GSList*-using methods.
* UIManager: Wrapped Error-using methods, with optional errthrow
parameter of _WRAP_METHOD().
* gtk/src/gtk_signals.defs: Updated with newly-generated defs from
extra_defs_gen, redoing the by-hand corrections.
* examples/book/dialogs/colorselection, fontselection: Used
the buttons instead. This will be moved into the buttons folder
later.
* examples/book/dialogs/messagedialog: Updated for new constructor
API.
2003-10-12 Murray Cumming <murrayc@usa.net>
......
......@@ -8,22 +8,28 @@
* New classes:
Gtk::
Action, ActionGroup, CellLayout, ComboBox, ComboxText, ComboBoxEntry, ColorButton, EntryCompletion,
Expander, FontButton, UIManager
Expander, FontButton, RadioAction, ToggleAction, UIManager
* New API for existing classes:
Gtk::Alignment: set_padding(), set_padding(). Useful for indenting Gtk::Frame contents.
Gtk::Button: get/set_focus_on_click()
Gtk::ButtonBox: get_child_secondary().
Gtk::Calendar:
display_options() is now set_display_options().
New properties.
- display_options() is now set_display_options().
- New properties.
Gtk::CheckMenuItem: get/set_draw_as_radio()
Gtk::Entry: get/set_completion()
Gtk::EventBox: get/set_visible_window(), get/set_above_child()
Gtk::IconSource: get/set_icon_name()
Gtk::Menu: attach()
Gtk::MessageDialog:
Constructors: Added bool use_markup paramater after message parameter. This is an API change.
Gtk::TextBuffer: select_range()
Gtk::TextIter (also known as Gtk::TextBuffer::iterator):
Added *_visible_* versions of forwards/backwards methods.
Gtk::TextView: get/set_overwrite(), get/set_accepts_tab()
Gtk::TreeViewColumn (also known as Gtk::TreeView::Column):
Added get/set_expand().
Gtk::Widget:
- queue_resize_no_redraw(), get/set__no_show_all()
- Added unset_fg(), unset_bg(), unset_font(), unset_text(), unset_base().
......@@ -33,7 +39,11 @@
(Detlef Reichl)
Gtk::Window: set_default_icon(), set_keep_above(), set_keep_below()
Gdk::Cursor: new constructor: Cursor(const Glib::RefPtr<Display>& display, const Glib::RefPtr<Pixbuf>& pixbuf, int x, int y)
Gdk::Display: flush(), supports_cursor_alpha(), supports_cursor_color(), get_default_cursor_size(),
get_maximal_cursor_size
Gdk::PixbufLoader: create() now has extra bool mime_type parameter.
Gdk::Window: set_keep_above(), set_keep_below().
2.2.2:
......
......@@ -21,20 +21,21 @@
ExampleWindow::ExampleWindow()
: m_Button("Show Dialog")
{
set_title("Gtk::ColorSelectionDialog example");
set_title("Gtk::ColorButton example");
set_default_size(200, 200);
add(m_VBox);
m_VBox.pack_start(m_Button, Gtk::PACK_SHRINK);
m_Button.signal_clicked().connect( SigC::slot(*this, &ExampleWindow::on_button_clicked) );
m_Button.signal_color_set().connect( SigC::slot(*this, &ExampleWindow::on_button_color_set) );
//Set start color:
m_Color.set_red(0);
m_Color.set_blue(65535);
m_Color.set_green(0);
m_Button.set_color(m_Color);
m_DrawingArea.modify_bg(Gtk::STATE_NORMAL, m_Color);
m_VBox.pack_start(m_DrawingArea);
......@@ -46,35 +47,9 @@ ExampleWindow::~ExampleWindow()
{
}
void ExampleWindow::on_button_clicked()
{
Gtk::ColorSelectionDialog dialog;
//Set the current color:
Gtk::ColorSelection* pColorSel = dialog.get_colorsel();
pColorSel->set_current_color(m_Color);
int result = dialog.run();
//Handle the response:
switch(result)
{
case(Gtk::RESPONSE_OK):
{
//Store the chosen color, and show it:
m_Color = pColorSel->get_current_color();
m_DrawingArea.modify_bg(Gtk::STATE_NORMAL, m_Color);
break;
}
case(Gtk::RESPONSE_CANCEL):
{
std::cout << "Cancel clicked." << std::endl;
break;
}
default:
{
std::cout << "Unexpected button clicked." << std::endl;
break;
}
}
void ExampleWindow::on_button_color_set()
{
//Store the chosen color, and show it:
m_Color = m_Button.get_color();
m_DrawingArea.modify_bg(Gtk::STATE_NORMAL, m_Color);
}
......@@ -29,11 +29,11 @@ public:
protected:
//Signal handlers:
virtual void on_button_clicked();
virtual void on_button_color_set();
//Child widgets:
Gtk::VBox m_VBox;
Gtk::Button m_Button;
Gtk::ColorButton m_Button;
Gtk::DrawingArea m_DrawingArea; //To show the color.
Gdk::Color m_Color;
......
......@@ -21,12 +21,12 @@
ExampleWindow::ExampleWindow()
: m_Button("Show Dialog")
: m_Button("sans")
{
set_title("Gtk::FontSelectionDialog example");
add(m_Button);
m_Button.signal_clicked().connect( SigC::slot(*this, &ExampleWindow::on_button_clicked) );
m_Button.signal_font_set().connect( SigC::slot(*this, &ExampleWindow::on_button_font_set) );
show_all_children();
}
......@@ -35,30 +35,8 @@ ExampleWindow::~ExampleWindow()
{
}
void ExampleWindow::on_button_clicked()
void ExampleWindow::on_button_font_set()
{
Gtk::FontSelectionDialog dialog;
int result = dialog.run();
//Handle the response:
switch(result)
{
case(Gtk::RESPONSE_OK):
{
Glib::ustring font_name = dialog.get_font_name();
std::cout << "Font chosen: " << font_name << std::endl;
break;
}
case(Gtk::RESPONSE_CANCEL):
{
std::cout << "Cancel clicked." << std::endl;
break;
}
default:
{
std::cout << "Unexpected button clicked." << std::endl;
break;
}
}
Glib::ustring font_name = m_Button.get_font_name();
std::cout << "Font chosen: " << font_name << std::endl;
}
......@@ -29,10 +29,10 @@ public:
protected:
//Signal handlers:
virtual void on_button_clicked();
virtual void on_button_font_set();
//Child widgets:
Gtk::Button m_Button;
Gtk::FontButton m_Button;
};
#endif //GTKMM_EXAMPLEWINDOW_H
......@@ -50,7 +50,7 @@ void ExampleWindow::on_button_info_clicked()
void ExampleWindow::on_button_question_clicked()
{
Gtk::MessageDialog dialog(*this, "This is a QUESTION MessageDialog", Gtk::MESSAGE_QUESTION, (Gtk::ButtonsType)(Gtk::BUTTONS_OK | Gtk::BUTTONS_CANCEL));
Gtk::MessageDialog dialog(*this, "This is a QUESTION MessageDialog", false /* use_markup */, Gtk::MESSAGE_QUESTION, (Gtk::ButtonsType)(Gtk::BUTTONS_OK | Gtk::BUTTONS_CANCEL));
int result = dialog.run();
//Handle the response:
......
......@@ -45,6 +45,10 @@ Cursor::Cursor(const Glib::RefPtr<Display>& display, CursorType cursor_type)
gobject_ = gdk_cursor_new_for_display(display->gobj(), (GdkCursorType)cursor_type);
}
Cursor::Cursor(const Glib::RefPtr<Display>& display, const Glib::RefPtr<Pixbuf>& pixbuf, int x, int y)
{
gobject_ = gdk_cursor_new_from_pixbuf(display->gobj(), pixbuf->gobj(), x, y);
}
} //namespace Gdk
......@@ -22,7 +22,8 @@
#include <gdkmm/color.h>
#include <gdkmm/bitmap.h>
#include <gdkmm/display.h>
#include <gdk/gdkcursor.h>
#include <gdkmm/pixbuf.h>
//#include <gdk/gdkcursor.h> //TODO: Hide C header.
_DEFS(gdkmm,gdk)
_PINCLUDE(glibmm/private/object_p.h)
......@@ -41,11 +42,14 @@ class Cursor
_IGNORE(gdk_cursor_ref, gdk_cursor_unref)
public:
Cursor(CursorType cursor_type);
//TODO: Default cursor_type value:
explicit Cursor(CursorType cursor_type);
Cursor(const Glib::RefPtr<Pixmap>& source, const Glib::RefPtr<Pixmap>& mask,
const Color& fg, const Color& bg,
int x, int y);
Cursor(const Glib::RefPtr<Display>& display, CursorType cursor_type);
//TODO: Default cursor_type value:
explicit Cursor(const Glib::RefPtr<Display>& display, CursorType cursor_type);
Cursor(const Glib::RefPtr<Display>& display, const Glib::RefPtr<Pixbuf>& pixbuf, int x, int y);
_WRAP_METHOD(Glib::RefPtr<Display> get_display(), gdk_cursor_get_display)
_WRAP_METHOD(Glib::RefPtr<const Display> get_display() const, gdk_cursor_get_display)
......
......@@ -128,6 +128,12 @@ public:
_WRAP_METHOD(Glib::RefPtr<Pixmap> lookup_pixmap(GdkNativeWindow anid), gdk_pixmap_lookup_for_display)
_WRAP_METHOD(Glib::RefPtr<const Pixmap> lookup_pixmap(GdkNativeWindow anid) const, gdk_pixmap_lookup_for_display)
_WRAP_METHOD(void flush(), gdk_display_flush)
_WRAP_METHOD(bool supports_cursor_alpha() const, gdk_display_supports_cursor_alpha)
_WRAP_METHOD(bool supports_cursor_color() const, gdk_display_supports_cursor_color)
//TODO: May need #ifdef: _WRAP_METHOD(guint get_default_cursor_size() const, gdk_display_get_default_cursor_size)
_WRAP_METHOD(void get_maximal_cursor_size(guint& width, guint& height), gdk_display_get_maximal_cursor_size)
//TODO: wrap the vfuncs, though they are not very useful because people will not derive from this class? murrayc.
_WRAP_SIGNAL(void closed(bool is_error), closed)
......
This diff is collapsed.
......@@ -197,6 +197,9 @@ public:
_WRAP_METHOD(static void pointer_ungrab(guint32 time_), gdk_pointer_ungrab);
_WRAP_METHOD(GrabStatus keyboard_grab(bool owner_events, guint32 time_), gdk_keyboard_grab)
_WRAP_METHOD(static void keyboard_ungrab(guint32 time_), gdk_pointer_ungrab);
_WRAP_METHOD(void set_keep_above(bool setting = true), gdk_window_set_keep_above)
_WRAP_METHOD(void set_keep_below(bool setting = true), gdk_window_set_keep_below)
};
} /* namespace Gdk */
......
......@@ -29,9 +29,14 @@
namespace Gtk
{
//TODO: This will not work because:
// comboboxtext.cc:36: warning: base initializer for `Gtk::ComboBox'
// comboboxtext.cc:36: warning: will be re-ordered to precede member
//I have reorderd them myself now to avoid the warning, but this will segfault. murrayc.
ComboBoxText::ComboBoxText()
: Gtk::ComboBox(Gtk::ListStore::create(m_text_columns)) //Create a default treemodel. We must create it in the initializer list, because it is a construct-only property.
: Gtk::ComboBox(Gtk::ListStore::create(*m_text_columns)), //Create a default treemodel. We must create it in the initializer list, because it is a construct-only property.
m_text_columns(new TextModelColumns) //Allocate it dynamically so that it is guarranteed to be created at this point, so we can pass it to the base constructor.
{
Glib::RefPtr<TreeModel> model = get_model(); //Get the model that we just created in the initializer list.
......@@ -71,7 +76,7 @@ Glib::ustring ComboBoxText::get_active_text() const
if(active_row < children.size())
{
Gtk::TreeModel::Row row = children[active_row];
result = row[m_text_columns.m_column];
result = row[m_text_columns->m_column];
}
return result;
......
......@@ -71,7 +71,7 @@ protected:
Gtk::TreeModelColumn<Glib::ustring> m_column;
};
TextModelColumns m_text_columns;
std::auto_ptr<TextModelColumns> m_text_columns;
};
......
......@@ -20,14 +20,15 @@ files_general_hg = accelgroup.hg accellabel.hg action.hg actiongroup.hg adjustme
main.hg menu.hg menubar.hg menuitem.hg menushell.hg messagedialog.hg misc.hg \
notebook.hg object.hg optionmenu.hg \
paned.hg progressbar.hg \
radiobutton.hg radiomenuitem.hg range.hg rc.hg ruler.hg \
radioaction.hg radiobutton.hg radiomenuitem.hg range.hg rc.hg ruler.hg \
scale.hg scrollbar.hg scrolledwindow.hg selectiondata.hg \
separator.hg separatormenuitem.hg settings.hg sizegroup.hg spinbutton.hg statusbar.hg \
stockitem.hg style.hg \
table.hg tearoffmenuitem.hg \
textattributes.hg textbuffer.hg textchildanchor.hg textiter.hg textmark.hg texttag.hg texttagtable.hg textview.hg\
textattributes.hg textbuffer.hg textchildanchor.hg textiter.hg textmark.hg texttag.hg texttagtable.hg textview.hg \
toggleaction.hg \
togglebutton.hg toolbar.hg tooltips.hg treedragdest.hg treedragsource.hg treepath.hg treerowreference.hg treeselection.hg treesortable.hg \
treeiter.hg treemodel.hg treemodelsort.hg treestore.hg treeview.hg treeviewcolumn.hg \
treeiter.hg treemodel.hg treemodelfilter.hg treemodelsort.hg treestore.hg treeview.hg treeviewcolumn.hg \
uimanager.hg viewport.hg \
widget.hg window.hg
......
......@@ -38,17 +38,18 @@ public:
_WRAP_METHOD(Glib::ustring get_name() const, gtk_action_group_get_name)
_WRAP_METHOD(Glib::RefPtr<Action> get_action(const Glib::ustring& action_name), gtk_action_group_get_action)
_WRAP_METHOD(Glib::RefPtr<const Action> get_action(const Glib::ustring& action_name) const, gtk_action_group_get_action)
//TODO: _WRAP_METHOD(GList* list_actions(), gtk_action_group_list_actions)
//TODO: Const version:
_WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<Action> > list_actions(), gtk_action_group_list_actions)
_WRAP_METHOD(void add_action(const Glib::RefPtr<Action>& action), gtk_action_group_add_action)
_WRAP_METHOD(void remove_action(const Glib::RefPtr<Action>& action), gtk_action_group_remove_action)
//TODO: _WRAP_METHOD(void gtk_action_group_add_actions(GtkActionEntry *entries, guint n_entries, gpointer user_data), gtk_action_group_add_actions)
//TODO: _WRAP_METHOD(void gtk_action_group_add_toggle_actions(GtkToggleActionEntry *entries, guint n_entries, gpointer user_data), gtk_action_group_add_toggle_actions)
//TODO: _WRAP_METHOD(void gtk_action_group_add_radio_actions(GtkRadioActionEntry *entries, guint n_entries, int value, GCallback on_change, gpointer user_data), gtk_action_group_add_radio_actions), gtk_action_group_add_radio_actions)
//TODO: _WRAP_METHOD(void add_actions(GtkActionEntry *entries, guint n_entries, gpointer user_data), gtk_action_group_add_actions)
//TODO: _WRAP_METHOD(void add_toggle_actions(GtkToggleActionEntry *entries, guint n_entries, gpointer user_data), gtk_action_group_add_toggle_actions)
//TODO: _WRAP_METHOD(void add_radio_actions(GtkRadioActionEntry *entries, guint n_entries, int value, GCallback on_change, gpointer user_data), gtk_action_group_add_radio_actions), gtk_action_group_add_radio_actions)
//TODO: _WRAP_METHOD(void add_actions_full(GtkActionEntry* entries, guint n_entries, gpointer user_data, GDestroyNotify destroy), gtk_action_group_add_actions_full)
//TODO: _WRAP_METHOD(void add_toggle_actions_full(GtkToggleActionEntry *entries, guint n_entries, gpointer user_data, GDestroyNotify destroy), gtk_action_group_add_toggle_actions_full)
//TODO: _WRAP_METHOD(void add_radio_actions_full(GtkRadioActionEntry *entries, guint n_entries, int value, GCallback on_change, gpointer user_data, GDestroyNotify destroy), gtk_action_group_add_radio_actions_full)
//TODO: _WRAP_METHOD(void set_translate_func(GtkTranslateFunc func, gpointer data, GtkDestroyNotify notify), gtk_action_group_set_translate_func), gtk_action_group_set_translate_func)
//TODO: _WRAP_METHOD(void set_translation_domain(const Glib::ustring& domain), gtk_action_group_set_translation_domain), gtk_action_group_set_translation_domain)
_WRAP_METHOD(void set_translation_domain(const Glib::ustring& domain), gtk_action_group_set_translation_domain)
};
......
......@@ -26,14 +26,13 @@
namespace Gtk
{
/* TODO:
Gdk::Color ColorButton::get_color() const
{
Gdk::Color color;
gtk_color_button_get_color(gobj(), color.gobj())
gtk_color_button_get_color(const_cast<GtkColorButton*>(gobj()), color.gobj());
return color;
}
*/
} // namespace Gtk
......
......@@ -37,9 +37,9 @@ class ColorButton : public Button
_CLASS_GTKOBJECT(ColorButton, GtkColorButton, GTK_COLOR_BUTTON, Gtk::Button, GtkButton)
public:
_CTOR_DEFAULT()
_IGNORE(gtk_color_button_new)
_WRAP_CTOR(ColorButton(const Gdk::Color& color), gtk_color_button_new_with_color)
_WRAP_METHOD(void set_color(const Gdk::Color& color), gtk_color_button_set_color)
_WRAP_METHOD(void set_alpha(guint16 alpha), gtk_color_button_set_alpha)
Gdk::Color get_color() const;
......
......@@ -28,5 +28,10 @@
namespace Gtk
{
void ComboBox::unset_active()
{
gtk_combo_box_set_active(gobj(), -1 /* see GTK+ docs */);
}
} // namespace Gtk
......@@ -52,7 +52,10 @@ public:
/* get/set active item */
_WRAP_METHOD(int get_active() const, gtk_combo_box_get_active)
_WRAP_METHOD(TreeIter get_active_iter() const, gtk_combo_box_get_active_iter)
_WRAP_METHOD(void set_active(int index), gtk_combo_box_set_active)
_WRAP_METHOD(void set_active(const TreeIter& iter), gtk_combo_box_set_active_iter)
void unset_active();
/* getters and setters */
_WRAP_METHOD(Glib::RefPtr<TreeModel> get_model(), gtk_combo_box_get_model)
......
......@@ -42,7 +42,7 @@ public:
_WRAP_METHOD(void set_title(const Glib::ustring& title), gtk_font_button_set_title)
_WRAP_METHOD(bool get_use_font() const, gtk_font_button_get_use_font)
_WRAP_METHOD(void set_use_font(bool use_font = true), gtk_font_button_set_use_font)
_WRAP_METHOD(bool get_use_size() const, boolgtk_font_button_get_use_size)
_WRAP_METHOD(bool get_use_size() const, gtk_font_button_get_use_size)
_WRAP_METHOD(void set_use_size(bool use_size = true), gtk_font_button_set_use_size)
_WRAP_METHOD(Glib::ustring get_font_name() const, gtk_font_button_get_font_name)
_WRAP_METHOD(bool set_font_name(const Glib::ustring& fontname), gtk_font_button_set_font_name)
......
......@@ -27,17 +27,17 @@
namespace Gtk
{
MessageDialog::MessageDialog(const Glib::ustring& message,
MessageDialog::MessageDialog(const Glib::ustring& message, bool use_markup,
MessageType type, ButtonsType buttons,
bool modal, bool use_separator)
:
_CONSTRUCT("message_type", (GtkMessageType)type, "buttons", (GtkButtonsType)buttons)
{
construct_(modal, use_separator);
set_message(message);
set_message(message, use_markup);
}
MessageDialog::MessageDialog(Gtk::Window& parent, const Glib::ustring& message,
MessageDialog::MessageDialog(Gtk::Window& parent, const Glib::ustring& message, bool use_markup,
MessageType type, ButtonsType buttons,
bool modal, bool use_separator)
:
......@@ -45,15 +45,18 @@ MessageDialog::MessageDialog(Gtk::Window& parent, const Glib::ustring& message,
{
construct_(modal, use_separator);
set_transient_for(parent);
set_message(message);
set_message(message, use_markup);
}
void MessageDialog::set_message(const Glib::ustring& message)
void MessageDialog::set_message(const Glib::ustring& message, bool use_markup)
{
// The label is really a <private> struct field.
// TODO: The label is really a <private> struct field.
// There should really be a message property.
gtk_label_set_text(GTK_LABEL(gobj()->label), message.c_str());
if(use_markup)
gtk_label_set_markup(GTK_LABEL(gobj()->label), message.c_str());
else
gtk_label_set_text(GTK_LABEL(gobj()->label), message.c_str());
}
} // namespace Gtk
......
......@@ -47,12 +47,12 @@ class MessageDialog : public Dialog
_CLASS_GTKOBJECT(MessageDialog,GtkMessageDialog,GTK_MESSAGE_DIALOG,Gtk::Dialog,GtkDialog)
_UNMANAGEABLE
public:
explicit MessageDialog(const Glib::ustring& message, MessageType type = MESSAGE_INFO, ButtonsType buttons = BUTTONS_OK , bool modal = false, bool use_separator = false);
MessageDialog(Gtk::Window& parent, const Glib::ustring& message, MessageType type = MESSAGE_INFO, ButtonsType buttons = BUTTONS_OK , bool modal = false, bool use_separator = false);
//TODO: gtk_message_dialog_new_with_markup
explicit MessageDialog(const Glib::ustring& message, bool use_markup = false, MessageType type = MESSAGE_INFO, ButtonsType buttons = BUTTONS_OK, bool modal = false, bool use_separator = false);
MessageDialog(Gtk::Window& parent, const Glib::ustring& message, bool use_markup = false, MessageType type = MESSAGE_INFO, ButtonsType buttons = BUTTONS_OK, bool modal = false, bool use_separator = false);
_IGNORE(gtk_message_dialog_new, gtk_message_dialog_new_with_markup)
protected:
void set_message(const Glib::ustring& message);
void set_message(const Glib::ustring& message, bool use_markup);
};
} // namespace Gtk
......
// -*- c++ -*-
/* $Id$ */
/* Copyright 2003 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <gtk/gtkradioaction.h>
namespace Gtk
{
} // namespace Gtk
/* $Id$ */
/* Copyright (C) 2003 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <gtkmm/widget.h>
#include <gtkmm/accelgroup.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(glibmm/private/object_p.h)
namespace Gtk
{
class RadioAction : public Glib::Object
{
_CLASS_GOBJECT(RadioAction, GtkRadioAction, GTK_RADIO_ACTION, Glib::Object, GObject)
public:
//TODO: const version:
_WRAP_METHOD(Glib::SListHandle< Glib::RefPtr<RadioAction> > get_group(), gtk_radio_action_get_group)
_WRAP_METHOD(void set_group(const Glib::SListHandle< Glib::RefPtr<RadioAction> >& group), gtk_radio_action_set_group)
_WRAP_METHOD(int get_current_value() const, gtk_radio_action_get_current_value)
_WRAP_SIGNAL(void changed(const Glib::RefPtr<RadioAction>& current), changed)
_WRAP_PROPERTY("value", int)
};
} // namespace Gtk
......@@ -154,6 +154,14 @@ public:
_WRAP_METHOD(bool forward_word_ends(int count), gtk_text_iter_forward_word_ends)
_WRAP_METHOD(bool backward_word_starts(int count), gtk_text_iter_backward_word_starts)
//TODO: Now that there are so many *_visible_ versions of the methods, maybe we should
//just add a visible=false parameter and therefore halve the number of methods. murrayc
_WRAP_METHOD(bool forward_visible_word_end(), gtk_text_iter_forward_visible_word_end)
_WRAP_METHOD(bool backward_visible_word_start(), gtk_text_iter_backward_visible_word_start)
_WRAP_METHOD(bool forward_visible_word_ends(int count), gtk_text_iter_forward_visible_word_ends)
_WRAP_METHOD(bool backward_visible_word_starts(int count), gtk_text_iter_backward_visible_word_starts)
_WRAP_METHOD(bool forward_sentence_end(), gtk_text_iter_forward_sentence_end)
_WRAP_METHOD(bool backward_sentence_start(), gtk_text_iter_backward_sentence_start)
_WRAP_METHOD(bool forward_sentence_ends(int count), gtk_text_iter_forward_sentence_ends)
......@@ -164,6 +172,11 @@ public:
_WRAP_METHOD(bool forward_cursor_positions(int count), gtk_text_iter_forward_cursor_positions)
_WRAP_METHOD(bool backward_cursor_positions(int count), gtk_text_iter_backward_cursor_positions)
_WRAP_METHOD(bool forward_visible_cursor_position (), gtk_text_iter_forward_visible_cursor_position)
_WRAP_METHOD(bool backward_visible_cursor_position (), gtk_text_iter_backward_visible_cursor_position)
_WRAP_METHOD(bool forward_visible_cursor_positions(int count), gtk_text_iter_forward_visible_cursor_positions)
_WRAP_METHOD(bool backward_visible_cursor_positions(int count), gtk_text_iter_backward_visible_cursor_positions)
_WRAP_METHOD(void set_offset(int char_offset), gtk_text_iter_set_offset)
_WRAP_METHOD(void set_line(int line_number), gtk_text_iter_set_line)
_WRAP_METHOD(void set_line_offset(int char_on_line), gtk_text_iter_set_line_offset)
......
// -*- c++ -*-
/* $Id$ */
/* Copyright 2003 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <gtk/gtktoggleaction.h>
namespace Gtk
{
} // namespace Gtk
/* $Id$ */
/* Copyright (C) 2003 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <gtkmm/widget.h>
#include <gtkmm/accelgroup.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(glibmm/private/object_p.h)
namespace Gtk
{
class ToggleAction : public Glib::Object
{
_CLASS_GOBJECT(ToggleAction, GtkToggleAction, GTK_TOGGLE_ACTION, Glib::Object, GObject)
public:
_WRAP_METHOD(void toggled(), gtk_toggle_action_toggled)
_WRAP_METHOD(void set_active(bool is_active = true), gtk_toggle_action_set_active)
_WRAP_METHOD(bool get_active() const, gtk_toggle_action_get_active)
_WRAP_METHOD(void set_draw_as_radio(bool draw_as_radio = true), gtk_toggle_action_set_draw_as_radio)
_WRAP_METHOD(bool get_draw_as_radio() const, gtk_toggle_action_get_draw_as_radio)
_WRAP_SIGNAL(void toggled(), "toggled")
_WRAP_PROPERTY("draw_as_radio", bool)
};
} // namespace Gtk
// -*- c++ -*-
/* $Id$ */
/* Copyright 1998-2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <gtk/gtktreemodelfilter.h>
namespace Gtk
{
} // namespace Gtk
/* $Id$ */
/* Copyright(C) 1998-2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or(at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <gtkmm/treeiter.h>
#include <gtkmm/treemodel.h>
// We couldn't include it in treemodel.h, but doing it here makes it easier for people.
#include <gtkmm/treepath.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(glibmm/private/object_p.h)
namespace Gtk
{
/**
* @ingroup TreeView
*
*/
class TreeModelFilter :
public Glib::Object,
public TreeModel
{
_CLASS_GOBJECT(TreeModelFilter, GtkTreeModelFilter, GTK_TREE_MODEL_FILTER, Glib::Object, GObject)
_IMPLEMENTS_INTERFACE(TreeModel)
protected:
_WRAP_CTOR(TreeModelFilter(const Glib::RefPtr<TreeModel>& child_model, const TreePath& root), gtk_tree_model_filter_new)
public:
_WRAP_CREATE(const Glib::RefPtr<TreeModel>& child_model, const TreePath& root)