comparison dwtest.c @ 193:efd4703450fa

Build test application on Unix too... and also fixed GTK to allow OS/2 style colors in dw_color_xxx_set().
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 17 Jan 2003 23:52:44 +0000
parents d946e329670c
children b023d363fc09
comparison
equal deleted inserted replaced
192:d946e329670c 193:efd4703450fa
59 59
60 dw_box_pack_start(lbbox, stext, 130, 15, TRUE, TRUE, 2); 60 dw_box_pack_start(lbbox, stext, 130, 15, TRUE, TRUE, 2);
61 61
62 browsebox = dw_box_new(BOXHORZ, 0); 62 browsebox = dw_box_new(BOXHORZ, 0);
63 63
64 dw_box_pack_start(lbbox, browsebox, 130, 15, TRUE, TRUE, 0); 64 dw_box_pack_start(lbbox, browsebox, 0, 0, TRUE, TRUE, 0);
65 65
66 entryfield = dw_entryfield_new("", 100L); 66 entryfield = dw_entryfield_new("", 100L);
67 67
68 dw_box_pack_start(browsebox, entryfield, 100, 15, TRUE, TRUE, 4); 68 dw_box_pack_start(browsebox, entryfield, 100, 15, TRUE, TRUE, 4);
69 69
108 dw_window_set_font(entryfield, "9.WarpSans"); 108 dw_window_set_font(entryfield, "9.WarpSans");
109 109
110 /* Buttons */ 110 /* Buttons */
111 buttonbox = dw_box_new(BOXHORZ, 10); 111 buttonbox = dw_box_new(BOXHORZ, 10);
112 112
113 dw_box_pack_start(lbbox, buttonbox, 140, 210, TRUE, TRUE, 0); 113 dw_box_pack_start(lbbox, buttonbox, 0, 0, TRUE, TRUE, 0);
114 114
115 okbutton = dw_button_new("Ok", 1001L); 115 okbutton = dw_button_new("Ok", 1001L);
116 116
117 dw_box_pack_start(buttonbox, okbutton, 130, 30, TRUE, TRUE, 2); 117 dw_box_pack_start(buttonbox, okbutton, 130, 30, TRUE, TRUE, 2);
118 118
147 return TRUE; 147 return TRUE;
148 } 148 }
149 149
150 void text_add(void) 150 void text_add(void)
151 { 151 {
152 int i,x,y; 152 int i,y,depth = dw_color_depth();
153 char buf[10]; 153 char buf[10];
154 HPIXMAP text1pm,text2pm; 154 HPIXMAP text1pm,text2pm;
155 155
156 pagebox = dw_box_new(BOXVERT, 5); 156 pagebox = dw_box_new(BOXVERT, 5);
157 dw_box_pack_start( notebookbox2, pagebox, 1, 1, TRUE, TRUE, 0); 157 dw_box_pack_start( notebookbox2, pagebox, 1, 1, TRUE, TRUE, 0);
158 158
159 textbox1 = dw_render_new( 100 ); 159 textbox1 = dw_render_new( 100 );
160 dw_box_pack_start( pagebox, textbox1, font_width*width1, font_height*rows, FALSE, TRUE, 4); 160 dw_box_pack_start( pagebox, textbox1, font_width*width1, font_height*rows, TRUE, TRUE, 4);
161 dw_window_set_font(textbox1, "9.WarpSans"); 161 dw_window_set_font(textbox1, "9.WarpSans");
162 162
163 textbox2 = dw_render_new( 101 ); 163 textbox2 = dw_render_new( 101 );
164 dw_box_pack_start( pagebox, textbox2, font_width*width2, font_height*rows, TRUE, TRUE, 4); 164 dw_box_pack_start( pagebox, textbox2, font_width*width2, font_height*rows, TRUE, TRUE, 4);
165 dw_window_set_font(textbox2, "9.WarpSans"); 165 dw_window_set_font(textbox2, "9.WarpSans");
166 166
167 text1pm = dw_pixmap_new( textbox1, font_width*width1, font_height*rows, 32 ); 167 text1pm = dw_pixmap_new( textbox1, font_width*width1, font_height*rows, depth );
168 text2pm = dw_pixmap_new( textbox2, font_width*width2, font_height*rows, 32 ); 168 text2pm = dw_pixmap_new( textbox2, font_width*width2, font_height*rows, depth );
169 169
170 dw_color_foreground_set(DW_CLR_WHITE); 170 dw_color_foreground_set(DW_CLR_WHITE);
171 dw_draw_rect(0, text1pm, TRUE, 0, 0, font_width*width1, font_height*rows); 171 dw_draw_rect(0, text1pm, TRUE, 0, 0, font_width*width1, font_height*rows);
172 dw_draw_rect(0, text2pm, TRUE, 0, 0, font_width*width2, font_height*rows); 172 dw_draw_rect(0, text2pm, TRUE, 0, 0, font_width*width2, font_height*rows);
173 173
208 dw_window_set_font( notebook, "8.WarpSans"); 208 dw_window_set_font( notebook, "8.WarpSans");
209 209
210 notebookbox1 = dw_box_new( BOXVERT, 5 ); 210 notebookbox1 = dw_box_new( BOXVERT, 5 );
211 notebookpage1 = dw_notebook_page_new( notebook, 0, TRUE ); 211 notebookpage1 = dw_notebook_page_new( notebook, 0, TRUE );
212 dw_notebook_pack( notebook, notebookpage1, notebookbox1 ); 212 dw_notebook_pack( notebook, notebookpage1, notebookbox1 );
213 fprintf( stderr, "page1: %d\n", notebookpage1 ); 213 fprintf( stderr, "page1: %ld\n", notebookpage1 );
214 dw_notebook_page_set_text( notebook, notebookpage1, "first page"); 214 dw_notebook_page_set_text( notebook, notebookpage1, "first page");
215 archive_add(); 215 archive_add();
216 216
217 notebookbox2 = dw_box_new( BOXVERT, 5 ); 217 notebookbox2 = dw_box_new( BOXVERT, 5 );
218 notebookpage2 = dw_notebook_page_new( notebook, 1, FALSE ); 218 notebookpage2 = dw_notebook_page_new( notebook, 1, FALSE );
219 dw_notebook_pack( notebook, notebookpage2, notebookbox2 ); 219 dw_notebook_pack( notebook, notebookpage2, notebookbox2 );
220 fprintf( stderr, "page2: %d\n",notebookpage2); 220 fprintf( stderr, "page2: %ld\n",notebookpage2);
221 dw_notebook_page_set_text( notebook, notebookpage2, "second page"); 221 dw_notebook_page_set_text( notebook, notebookpage2, "second page");
222 text_add(); 222 text_add();
223 223
224 dw_signal_connect(mainwindow, "delete_event", DW_SIGNAL_FUNC(exit_callback), (void *)mainwindow); 224 dw_signal_connect(mainwindow, "delete_event", DW_SIGNAL_FUNC(exit_callback), (void *)mainwindow);
225 dw_window_set_usize(mainwindow, 640, 480); 225 dw_window_set_usize(mainwindow, 640, 480);