comparison lwlib/lwlib-Xaw.c @ 14:9ee227acff29 r19-15b90

Import from CVS: tag r19-15b90
author cvs
date Mon, 13 Aug 2007 08:48:42 +0200
parents bcdc7deadc19
children 131b0175ea99
comparison
equal deleted inserted replaced
13:13c6d0aaafe5 14:9ee227acff29
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details. 14 GNU General Public License for more details.
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with GNU Emacs; see the file COPYING. If not, write to 17 along with XEmacs; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */ 19 Boston, MA 02111-1307, USA. */
20 20
21 #include <stdio.h> 21 #include <stdio.h>
22 22
282 } 282 }
283 283
284 override = XtParseTranslationTable (overrideTrans); 284 override = XtParseTranslationTable (overrideTrans);
285 285
286 ac = 0; 286 ac = 0;
287 XtSetArg (av[ac], XtNtitle, shell_title); ac++; 287 XtSetArg (av[ac], XtNtitle, shell_title); ac++;
288 XtSetArg (av[ac], XtNallowShellResize, True); ac++; 288 XtSetArg (av[ac], XtNallowShellResize, True); ac++;
289 XtSetArg (av[ac], XtNtransientFor, parent); ac++; 289 XtSetArg (av[ac], XtNtransientFor, parent); ac++;
290 shell = XtCreatePopupShell ("dialog", transientShellWidgetClass, 290 shell = XtCreatePopupShell ("dialog", transientShellWidgetClass,
291 parent, av, ac); 291 parent, av, ac);
292 XtOverrideTranslations (shell, override); 292 XtOverrideTranslations (shell, override);
293 293
294 ac = 0; 294 ac = 0;
297 bc = 0; 297 bc = 0;
298 button = 0; 298 button = 0;
299 for (i = 0; i < left_buttons; i++) 299 for (i = 0; i < left_buttons; i++)
300 { 300 {
301 ac = 0; 301 ac = 0;
302 XtSetArg (av [ac], XtNfromHoriz, button); ac++; 302 XtSetArg (av [ac], XtNfromHoriz, button); ac++;
303 XtSetArg (av [ac], XtNleft, XtChainLeft); ac++; 303 XtSetArg (av [ac], XtNleft, XtChainLeft); ac++;
304 XtSetArg (av [ac], XtNright, XtChainLeft); ac++; 304 XtSetArg (av [ac], XtNright, XtChainLeft); ac++;
305 XtSetArg (av [ac], XtNtop, XtChainBottom); ac++; 305 XtSetArg (av [ac], XtNtop, XtChainBottom); ac++;
306 XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++; 306 XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++;
307 XtSetArg (av [ac], XtNresizable, True); ac++; 307 XtSetArg (av [ac], XtNresizable, True); ac++;
308 sprintf (button_name, "button%d", ++bc); 308 sprintf (button_name, "button%d", ++bc);
309 button = XtCreateManagedWidget (button_name, commandWidgetClass, 309 button = XtCreateManagedWidget (button_name, commandWidgetClass,
310 dialog, av, ac); 310 dialog, av, ac);
311 } 311 }
312 if (right_buttons) 312 if (right_buttons)
317 the right and the buttons on the left (that is I want the buttons 317 the right and the buttons on the left (that is I want the buttons
318 after the separator to be packed against the right edge of the 318 after the separator to be packed against the right edge of the
319 window) but I can't seem to make it do it. 319 window) but I can't seem to make it do it.
320 */ 320 */
321 ac = 0; 321 ac = 0;
322 XtSetArg (av [ac], XtNfromHoriz, button); ac++; 322 XtSetArg (av [ac], XtNfromHoriz, button); ac++;
323 /* XtSetArg (av [ac], XtNfromVert, XtNameToWidget (dialog, "label")); ac++; */ 323 /* XtSetArg (av [ac], XtNfromVert, XtNameToWidget (dialog, "label")); ac++; */
324 XtSetArg (av [ac], XtNleft, XtChainLeft); ac++; 324 XtSetArg (av [ac], XtNleft, XtChainLeft); ac++;
325 XtSetArg (av [ac], XtNright, XtChainRight); ac++; 325 XtSetArg (av [ac], XtNright, XtChainRight); ac++;
326 XtSetArg (av [ac], XtNtop, XtChainBottom); ac++; 326 XtSetArg (av [ac], XtNtop, XtChainBottom); ac++;
327 XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++; 327 XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++;
328 XtSetArg (av [ac], XtNlabel, ""); ac++; 328 XtSetArg (av [ac], XtNlabel, ""); ac++;
329 XtSetArg (av [ac], XtNwidth, 30); ac++; /* #### aaack!! */ 329 XtSetArg (av [ac], XtNwidth, 30); ac++; /* #### aaack!! */
330 XtSetArg (av [ac], XtNborderWidth, 0); ac++; 330 XtSetArg (av [ac], XtNborderWidth, 0); ac++;
331 XtSetArg (av [ac], XtNshapeStyle, XmuShapeRectangle); ac++; 331 XtSetArg (av [ac], XtNshapeStyle, XmuShapeRectangle); ac++;
339 dialog, av, ac); 339 dialog, av, ac);
340 } 340 }
341 for (i = 0; i < right_buttons; i++) 341 for (i = 0; i < right_buttons; i++)
342 { 342 {
343 ac = 0; 343 ac = 0;
344 XtSetArg (av [ac], XtNfromHoriz, button); ac++; 344 XtSetArg (av [ac], XtNfromHoriz, button); ac++;
345 XtSetArg (av [ac], XtNleft, XtChainRight); ac++; 345 XtSetArg (av [ac], XtNleft, XtChainRight); ac++;
346 XtSetArg (av [ac], XtNright, XtChainRight); ac++; 346 XtSetArg (av [ac], XtNright, XtChainRight); ac++;
347 XtSetArg (av [ac], XtNtop, XtChainBottom); ac++; 347 XtSetArg (av [ac], XtNtop, XtChainBottom); ac++;
348 XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++; 348 XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++;
349 XtSetArg (av [ac], XtNresizable, True); ac++; 349 XtSetArg (av [ac], XtNresizable, True); ac++;
350 sprintf (button_name, "button%d", ++bc); 350 sprintf (button_name, "button%d", ++bc);
351 button = XtCreateManagedWidget (button_name, commandWidgetClass, 351 button = XtCreateManagedWidget (button_name, commandWidgetClass,
352 dialog, av, ac); 352 dialog, av, ac);
353 } 353 }
354 354
555 static Widget 555 static Widget
556 xaw_create_scrollbar (widget_instance *instance, int vertical) 556 xaw_create_scrollbar (widget_instance *instance, int vertical)
557 { 557 {
558 Arg av[10]; 558 Arg av[10];
559 int ac = 0; 559 int ac = 0;
560 560
561 static XtCallbackRec jumpCallbacks[2] = 561 static XtCallbackRec jumpCallbacks[2] =
562 { {xaw_scrollbar_jump, NULL}, {NULL, NULL} }; 562 { {xaw_scrollbar_jump, NULL}, {NULL, NULL} };
563 563
564 static XtCallbackRec scrollCallbacks[2] = 564 static XtCallbackRec scrollCallbacks[2] =
565 { {xaw_scrollbar_scroll, NULL}, {NULL, NULL} }; 565 { {xaw_scrollbar_scroll, NULL}, {NULL, NULL} };