filefind.h File Reference

#include <gtk/gtk.h>
Include dependency graph for filefind.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

G_BEGIN_DECLS GtkWidget * filefind_dialog_create (GtkWidget *parent)
void filefind_locale_changed ()
const gchar * filefind_get_text ()

Function Documentation

G_BEGIN_DECLS GtkWidget* filefind_dialog_create ( GtkWidget *  parent  ) 

File Name : filefind.h

Description: File find dialog Copyright (C) 2009 iRex Technologies B.V. All rights reserved.

Definition at line 67 of file filefind.c.

References BUTTON_HEIGHT, BUTTON_WIDTH, ergtk_keyb_new(), filefind_locale_changed(), filefind_on_cancel_button_clicked(), filefind_on_hbox_size_allocate(), filefind_on_search_button_clicked(), g_cancel_button, g_dialog, g_input_entry, g_lastsearch, g_search_button, g_search_label, POPUP_DIALOG_H_PADDING, POPUP_DIALOG_H_SPACING, POPUP_DIALOG_V_PADDING, POPUP_DIALOG_V_SPACING, POPUP_DIALOG_WIDTH, TEXT_ENTRY_HEIGHT, and TEXT_ENTRY_WIDTH.

Referenced by fileview_show_search_dialog().

00068 {
00069     // dialog
00070     GtkWidget* dialog = gtk_dialog_new ();
00071     gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE);
00072     gtk_window_set_title (GTK_WINDOW(dialog), "");
00073     gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE);
00074     gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(parent));
00075     gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
00076     g_dialog = dialog;
00077 
00078     // alignment
00079     GtkWidget* alignment = gtk_alignment_new(0.0, 0.0, 1.0, 0);
00080     gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 
00081                               POPUP_DIALOG_V_PADDING, 
00082                               POPUP_DIALOG_V_PADDING, 
00083                               POPUP_DIALOG_H_PADDING, 
00084                               POPUP_DIALOG_H_PADDING);
00085     gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), alignment);
00086 
00087     // vbox
00088     GtkWidget* vbox = gtk_vbox_new(FALSE, POPUP_DIALOG_V_SPACING);
00089     gtk_container_add(GTK_CONTAINER(alignment), vbox);
00090 
00091     // search_label_widget
00092     GtkWidget * search_label_widget = gtk_label_new("");
00093     gtk_widget_set_name(search_label_widget, "irex-uds-search-label");
00094     gtk_widget_set_size_request(search_label_widget, 
00095             POPUP_DIALOG_WIDTH - 2 * POPUP_DIALOG_H_PADDING, -1);
00096     gtk_misc_set_alignment(GTK_MISC(search_label_widget), 0.0, 0.0);
00097     gtk_label_set_justify(GTK_LABEL(search_label_widget), GTK_JUSTIFY_LEFT);
00098     gtk_label_set_single_line_mode(GTK_LABEL(search_label_widget), FALSE);
00099     gtk_label_set_line_wrap(GTK_LABEL(search_label_widget), TRUE);
00100     gtk_label_set_ellipsize(GTK_LABEL(search_label_widget), PANGO_ELLIPSIZE_NONE);
00101     gtk_box_pack_start(GTK_BOX(vbox), search_label_widget, TRUE, TRUE, 0);
00102     g_search_label = search_label_widget;
00103 
00104     // hbox
00105     GtkWidget* hbox = gtk_hbox_new(FALSE, POPUP_DIALOG_H_SPACING);
00106     gtk_widget_set_size_request(hbox, -1, -1);
00107     gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0);
00108 
00109     // input_entry
00110     GtkWidget* entry_widget = gtk_entry_new();
00111     gtk_widget_set_size_request(entry_widget, TEXT_ENTRY_WIDTH, TEXT_ENTRY_HEIGHT);
00112     if (g_lastsearch)
00113         gtk_entry_set_text(GTK_ENTRY(entry_widget), g_lastsearch);
00114     else 
00115         gtk_entry_set_text(GTK_ENTRY(entry_widget), "");
00116     gtk_box_pack_start(GTK_BOX(hbox), entry_widget, TRUE, TRUE, 0); 
00117     g_object_set(G_OBJECT(entry_widget), "im-context-inhibit", TRUE, NULL );
00118     g_object_set(G_OBJECT(entry_widget), "activates-default", TRUE, NULL );
00119     g_input_entry = entry_widget;
00120 
00121     // sub_hbox
00122     GtkWidget* sub_hbox = gtk_hbox_new(FALSE, POPUP_DIALOG_H_SPACING);
00123     gtk_box_pack_start(GTK_BOX(hbox), sub_hbox, FALSE, FALSE, 0); 
00124 
00125     // search_button
00126     GtkWidget* button_widget = gtk_button_new();
00127     gtk_widget_set_size_request(button_widget, BUTTON_WIDTH, BUTTON_HEIGHT);
00128     gtk_box_pack_start(GTK_BOX(sub_hbox), button_widget, FALSE, FALSE, 0); 
00129     g_search_button = button_widget;
00130     GTK_WIDGET_SET_FLAGS(g_search_button, GTK_CAN_DEFAULT);
00131     gtk_window_set_default(GTK_WINDOW(dialog), g_search_button);
00132     
00133     // cancel_button
00134     GtkWidget* cancel_widget = gtk_button_new();
00135     gtk_widget_set_size_request(cancel_widget, BUTTON_WIDTH, BUTTON_HEIGHT);
00136     gtk_box_pack_start(GTK_BOX(sub_hbox), cancel_widget, FALSE, FALSE, 0); 
00137     g_cancel_button = cancel_widget;
00138 
00139     // keyboard_widget
00140     GtkWidget* keyboard_widget = ergtk_keyb_new();
00141     gtk_box_pack_start(GTK_BOX(vbox), keyboard_widget, TRUE, TRUE, 10);
00142 
00143     // install signal hanlders.
00144     g_signal_connect(G_OBJECT(sub_hbox), "size-allocate",  
00145             G_CALLBACK(filefind_on_hbox_size_allocate), sub_hbox); 
00146     g_signal_connect(G_OBJECT(button_widget), "clicked", 
00147             G_CALLBACK(filefind_on_search_button_clicked), (gpointer) dialog);
00148     g_signal_connect(G_OBJECT(cancel_widget), "clicked", 
00149             G_CALLBACK(filefind_on_cancel_button_clicked), (gpointer) dialog);
00150 
00151 
00152     // Focus on the entry in order to show keyboard automatically.
00153     gtk_widget_grab_focus(entry_widget);
00154     
00155     filefind_locale_changed();
00156 
00157     gtk_widget_show_all(dialog);
00158     return dialog;
00159 }

Here is the call graph for this function:

Here is the caller graph for this function:

const gchar* filefind_get_text (  ) 

Definition at line 172 of file filefind.c.

References g_lastsearch.

Referenced by fileview_show_search_dialog().

00173 {
00174     return g_lastsearch;
00175 }

Here is the caller graph for this function:

void filefind_locale_changed (  ) 

Definition at line 162 of file filefind.c.

References g_cancel_button, g_search_button, and g_search_label.

Referenced by filefind_dialog_create().

00163 {
00164     gtk_label_set_text(GTK_LABEL(g_search_label), 
00165                        _("Type the name or author of the item you are looking for. Tap the Find button; the device will begin searching."));
00166 
00167     gtk_button_set_label(GTK_BUTTON(g_search_button), _("Find"));
00168     gtk_button_set_label(GTK_BUTTON(g_cancel_button), _("Cancel"));
00169 }

Here is the caller graph for this function:

Generated by  doxygen 1.6.2-20100208