1693
|
1
|
|
2 #ifndef __MY_MESSAGEBOX
|
|
3 #define __MY_MESSAGEBOX
|
|
4
|
|
5 GtkWidget * gtkMessageBoxText;
|
|
6
|
|
7 void on_MessageBox_destroy( GtkObject * object,gpointer user_data )
|
|
8 {
|
|
9 gtk_widget_hide( MessageBox );
|
|
10 gtkVisibleMessageBox=0;
|
|
11 }
|
|
12
|
|
13 void on_Ok_released( GtkButton * button,gpointer user_data )
|
|
14 {
|
|
15 gtk_widget_hide( MessageBox );
|
|
16 gtkVisibleMessageBox=0;
|
|
17 gtkSendMessage( evMessageBox );
|
|
18 }
|
|
19
|
|
20 GtkWidget * create_MessageBox( void )
|
|
21 {
|
|
22 GtkWidget *MessageBox;
|
|
23 GtkWidget *frame1;
|
|
24 GtkWidget *frame2;
|
|
25 GtkWidget *frame3;
|
|
26 GtkWidget *frame4;
|
|
27 GtkWidget *vbox1;
|
|
28 GtkWidget *vbox2;
|
|
29 GtkWidget *hseparator1;
|
|
30 GtkWidget *hbuttonbox1;
|
|
31 GtkWidget *Ok;
|
|
32 GtkAccelGroup *accel_group;
|
|
33
|
|
34 accel_group=gtk_accel_group_new();
|
|
35
|
|
36 MessageBox=gtk_window_new( GTK_WINDOW_DIALOG );
|
1884
|
37 gtk_widget_set_name( MessageBox,MSGTR_MessageBox );
|
|
38 gtk_object_set_data( GTK_OBJECT( MessageBox ),MSGTR_MessageBox,MessageBox );
|
1693
|
39 gtk_widget_set_usize( MessageBox,420,128 );
|
|
40 GTK_WIDGET_SET_FLAGS( MessageBox,GTK_CAN_FOCUS );
|
|
41 GTK_WIDGET_SET_FLAGS( MessageBox,GTK_CAN_DEFAULT );
|
|
42 gtk_widget_set_events( MessageBox,GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_FOCUS_CHANGE_MASK | GDK_STRUCTURE_MASK );
|
1884
|
43 gtk_window_set_title( GTK_WINDOW( MessageBox ),MSGTR_MessageBox );
|
1693
|
44 gtk_window_set_position( GTK_WINDOW( MessageBox ),GTK_WIN_POS_CENTER );
|
|
45 gtk_window_set_modal( GTK_WINDOW( MessageBox ),TRUE );
|
|
46 gtk_window_set_policy( GTK_WINDOW( MessageBox ),FALSE,FALSE,FALSE );
|
1884
|
47 gtk_window_set_wmclass( GTK_WINDOW( MessageBox ),MSGTR_MessageBox,MSGTR_MessageBox );
|
1693
|
48
|
|
49 frame1=gtk_frame_new( NULL );
|
|
50 gtk_widget_set_name( frame1,"frame1" );
|
|
51 gtk_widget_ref( frame1 );
|
|
52 gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"frame1",frame1,
|
|
53 ( GtkDestroyNotify ) gtk_widget_unref );
|
|
54 gtk_widget_show( frame1 );
|
|
55 gtk_container_add( GTK_CONTAINER( MessageBox ),frame1 );
|
|
56 gtk_frame_set_shadow_type( GTK_FRAME( frame1 ),GTK_SHADOW_IN );
|
|
57
|
|
58 frame2=gtk_frame_new( NULL );
|
|
59 gtk_widget_set_name( frame2,"frame2" );
|
|
60 gtk_widget_ref( frame2 );
|
|
61 gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"frame2",frame2,
|
|
62 ( GtkDestroyNotify ) gtk_widget_unref );
|
|
63 gtk_widget_show( frame2 );
|
|
64 gtk_container_add( GTK_CONTAINER( frame1 ),frame2 );
|
|
65 gtk_frame_set_shadow_type( GTK_FRAME( frame2 ),GTK_SHADOW_NONE );
|
|
66
|
|
67 frame3=gtk_frame_new( NULL );
|
|
68 gtk_widget_set_name( frame3,"frame3" );
|
|
69 gtk_widget_ref( frame3 );
|
|
70 gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"frame3",frame3,
|
|
71 ( GtkDestroyNotify ) gtk_widget_unref );
|
|
72 gtk_widget_show( frame3 );
|
|
73 gtk_container_add( GTK_CONTAINER( frame2 ),frame3 );
|
|
74
|
|
75 frame4=gtk_frame_new( NULL );
|
|
76 gtk_widget_set_name( frame4,"frame4" );
|
|
77 gtk_widget_ref( frame4 );
|
|
78 gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"frame4",frame4,
|
|
79 ( GtkDestroyNotify ) gtk_widget_unref );
|
|
80 gtk_widget_show( frame4 );
|
|
81 gtk_container_add( GTK_CONTAINER( frame3 ),frame4 );
|
|
82 gtk_frame_set_shadow_type( GTK_FRAME( frame4 ),GTK_SHADOW_NONE );
|
|
83
|
|
84 vbox1=gtk_vbox_new( FALSE,0 );
|
|
85 gtk_widget_set_name( vbox1,"vbox1" );
|
|
86 gtk_widget_ref( vbox1 );
|
|
87 gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"vbox1",vbox1,
|
|
88 ( GtkDestroyNotify ) gtk_widget_unref );
|
|
89 gtk_widget_show( vbox1 );
|
|
90 gtk_container_add( GTK_CONTAINER( frame4 ),vbox1 );
|
|
91
|
|
92 vbox2=gtk_vbox_new( FALSE,0 );
|
|
93 gtk_widget_set_name( vbox2,"vbox2" );
|
|
94 gtk_widget_ref( vbox2 );
|
|
95 gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"vbox2",vbox2,
|
|
96 ( GtkDestroyNotify ) gtk_widget_unref );
|
|
97 gtk_widget_show( vbox2 );
|
|
98 gtk_box_pack_start( GTK_BOX( vbox1 ),vbox2,TRUE,FALSE,0 );
|
|
99
|
|
100 gtkMessageBoxText=gtk_label_new( "Ez." );
|
|
101 gtk_widget_set_name( gtkMessageBoxText,"gtkMessageBoxText" );
|
|
102 gtk_widget_ref( gtkMessageBoxText );
|
|
103 gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"gtkMessageBoxText",gtkMessageBoxText,
|
|
104 ( GtkDestroyNotify ) gtk_widget_unref );
|
|
105 gtk_widget_show( gtkMessageBoxText );
|
|
106 gtk_box_pack_start( GTK_BOX( vbox2 ),gtkMessageBoxText,FALSE,FALSE,0 );
|
|
107 // gtk_widget_set_usize( gtkMessageBoxText,-2,77 );
|
|
108 gtk_widget_set_usize( gtkMessageBoxText,384,77 );
|
|
109 gtk_label_set_justify( GTK_LABEL( gtkMessageBoxText ),GTK_JUSTIFY_FILL );
|
|
110 gtk_label_set_line_wrap( GTK_LABEL( gtkMessageBoxText ),TRUE );
|
|
111
|
|
112 hseparator1=gtk_hseparator_new();
|
|
113 gtk_widget_set_name( hseparator1,"hseparator1" );
|
|
114 gtk_widget_ref( hseparator1 );
|
|
115 gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"hseparator1",hseparator1,
|
|
116 ( GtkDestroyNotify ) gtk_widget_unref );
|
|
117 gtk_widget_show( hseparator1 );
|
|
118 gtk_box_pack_start( GTK_BOX( vbox2 ),hseparator1,TRUE,TRUE,0 );
|
|
119
|
|
120 hbuttonbox1=gtk_hbutton_box_new();
|
|
121 gtk_widget_set_name( hbuttonbox1,"hbuttonbox1" );
|
|
122 gtk_widget_ref( hbuttonbox1 );
|
|
123 gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"hbuttonbox1",hbuttonbox1,
|
|
124 ( GtkDestroyNotify ) gtk_widget_unref );
|
|
125 gtk_widget_show( hbuttonbox1 );
|
|
126 gtk_box_pack_start( GTK_BOX( vbox1 ),hbuttonbox1,FALSE,FALSE,0 );
|
|
127 GTK_WIDGET_SET_FLAGS( hbuttonbox1,GTK_CAN_FOCUS );
|
|
128 GTK_WIDGET_SET_FLAGS( hbuttonbox1,GTK_CAN_DEFAULT );
|
|
129 gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),0 );
|
|
130 gtk_button_box_set_child_size( GTK_BUTTON_BOX( hbuttonbox1 ),60,0 );
|
|
131 gtk_button_box_set_child_ipadding( GTK_BUTTON_BOX( hbuttonbox1 ),10,0 );
|
|
132
|
1884
|
133 Ok=gtk_button_new_with_label( MSGTR_Ok );
|
|
134 gtk_widget_set_name( Ok,MSGTR_Ok );
|
1693
|
135 gtk_widget_ref( Ok );
|
1884
|
136 gtk_object_set_data_full( GTK_OBJECT( MessageBox ),MSGTR_Ok,Ok,
|
1693
|
137 ( GtkDestroyNotify ) gtk_widget_unref );
|
|
138 gtk_widget_show( Ok );
|
|
139 gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),Ok );
|
|
140 gtk_widget_set_usize( Ok,100,-2 );
|
|
141 GTK_WIDGET_SET_FLAGS( Ok,GTK_CAN_DEFAULT );
|
|
142 gtk_widget_add_accelerator( Ok,"released",accel_group,
|
|
143 GDK_Return,0,
|
|
144 GTK_ACCEL_VISIBLE );
|
|
145
|
|
146 gtk_signal_connect( GTK_OBJECT( MessageBox ),"destroy",
|
|
147 GTK_SIGNAL_FUNC( on_MessageBox_destroy ),
|
|
148 NULL );
|
|
149 gtk_signal_connect( GTK_OBJECT( Ok ),"released",
|
|
150 GTK_SIGNAL_FUNC( on_Ok_released ),
|
|
151 NULL );
|
|
152
|
|
153 gtk_window_add_accel_group( GTK_WINDOW( MessageBox ),accel_group );
|
|
154
|
|
155 return MessageBox;
|
|
156 }
|
|
157
|
1885
|
158 #endif
|