2 * ISF(Input Service Framework)
4 * ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable.
5 * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
7 * Contact: Shuo Liu <shuo0805.liu@samsung.com>, Hengliang Luo <hl.luo@samsung.com>
9 * This library is free software; you can redistribute it and/or modify it under
10 * the terms of the GNU Lesser General Public License as published by the
11 * Free Software Foundation; either version 2.1 of the License, or (at your option)
14 * This library is distributed in the hope that it will be useful, but WITHOUT ANY
15 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17 * License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this library; if not, write to the Free Software Foundation, Inc., 51
21 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26 #include "isf_help_win.h"
28 static GtkWidget *_main_window = 0;
29 static GtkWidget *_content_box = 0;
30 static GtkWidget *_help_label = 0;
31 static GtkWidget *_form = 0;
34 extern int _screen_width;
35 extern float _width_rate;
36 extern float _height_rate;
38 ISFHelpWin::ISFHelpWin ()
42 _main_window = gtk_main_window_new (GTK_WIN_STYLE_DEFAULT);
43 gtk_main_window_set_title_style (GTK_MAIN_WINDOW (_main_window), GTK_WIN_TITLE_STYLE_TEXT_ICON);
45 _form = gtk_form_new (TRUE);
46 gtk_form_set_title (GTK_FORM (_form), "Help");
47 GtkWidget *scroll = gtk_scrolled_window_new (NULL, NULL);
48 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll),
49 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
50 gtk_container_add (GTK_CONTAINER (_form), scroll);
52 _content_box = gtk_vbox_new (false, 0);
53 gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scroll), _content_box);
55 #ifdef USING_ISF_SWITCH_BUTTON
56 GtkWidget *softkey = GTK_WIDGET (gtk_form_get_softkey_bar (GTK_FORM (_form)));
57 gtk_softkey_bar_use_ise_switch (GTK_SOFTKEY_BAR (softkey), false);
58 gtk_softkey_bar_set_softkey (GTK_SOFTKEY_BAR (softkey), SOFTKEY4,
60 (SoftkeyActionType) SOFTKEY_CALLBACK,
61 (gpointer) (on_isf_help_back_callback),
64 gtk_form_add_softkey(GTK_FORM(_form), "Exit", NULL, SOFTKEY_CALLBACK, (void *)on_isf_help_back_callback, NULL);
68 gtk_main_window_add_form (GTK_MAIN_WINDOW (_main_window), GTK_FORM (_form));
69 gtk_main_window_set_current_form (GTK_MAIN_WINDOW (_main_window), GTK_FORM (_form));
70 gtk_widget_show_all (_form);
76 ISFHelpWin::~ISFHelpWin ()
79 gtk_widget_destroy (_main_window);
83 gtk_widget_destroy (_content_box);
87 gtk_widget_destroy (_help_label);
91 gtk_widget_destroy (_form);
96 void ISFHelpWin::show_help (const char *title, const char *help_info)
99 _help_label = gtk_label_new (help_info);
100 gtk_box_pack_start (GTK_BOX (_content_box), _help_label, true, true, 0);
102 gtk_form_set_title (GTK_FORM (_form), (gchar *)title);
104 gtk_widget_show_all (_form);
105 gtk_widget_show_all (_main_window);
106 gtk_window_present (GTK_WINDOW (_main_window));
109 gtk_window_present (GTK_WINDOW (_main_window));
113 void ISFHelpWin::on_isf_help_back_callback (GtkWidget *softkey,
116 gtk_widget_hide (_main_window);
118 gtk_widget_destroy (_help_label);
126 vi:ts=4:nowrap:ai:expandtab