home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
g
/
gina15.zip
/
demos
/
periodic.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-02-27
|
32KB
|
934 lines
// This may look like C code, but it is really -*- C++ -*-
// Module : periodic.C Version 1.8
// LastSCCS : 1/23/92 12:34:23
// LastEdit : "Wed Jan 22 13:08:27 1992"
// Description :
// Author : Andreas Baecker
// Copyright : GMD Schloss Birlinghoven
#include <Gina/GnBasic.h>
#include <Gina/GnMotif.h>
#include "face.h"
#include "motif_bitmap.h"
char *fixed_font = "fixed";
char *var_font = "variable";
char *small_font = "6x12";
char *dialog_font = "-adobe-helvetica-bold-r-normal--12-*-*-*-*-*-*-*";
char *subtitle_font = "-adobe-new century schoolbook-bold-r-normal--14-*-*-*-*-*-*-*";
char *heading_font = "-adobe-new century schoolbook-bold-r-normal--14-*-*-*-*-*-*-*";
char *hel_bold_font = "-adobe-helvetica-bold-r-normal--12-*-*-*-*-*-*-*";
char *hel_bold_font14 = "-adobe-helvetica-bold-r-normal--14-*-*-*-*-*-*-*";
char *newcenturyschlbk_roman14 = "-adobe-new century schoolbook-medium-r-normal--14-*-*-*-*-*-*-*";
char *newcenturyschlbk_roman12 = "-adobe-new century schoolbook-medium-r-normal--12-*-*-*-*-*-*-*";
char *newcenturyschlbk_bold14 = "-adobe-new century schoolbook-bold-r-normal--14-*-*-*-*-*-*-*";
char *newcenturyschlbk_bold24 = "-adobe-new century schoolbook-bold-r-normal--24-*-*-*-*-*-*-*";
char *times_bold_font = "-adobe-times-bold-r-normal--24-*-*-*-*-*-*-*";
int fudge = 2;
int dialog_fudge = 10;
int heading_fudge_x = 40;
int heading_fudge_y = 25;
int title_x = 270;
int title_y = 25;
int subtitle_x = title_x + 80;
int subtitle_y = title_y + 30;
int dont_panic_x = 7;
int dont_panic_y = 17;
int radioactive_x = 5;
int radioactive_y = 635;
int radioactive_height = 100;
int radioactive_width = 210;
int radioactive_title_x = radioactive_x;
int radioactive_title_y = radioactive_y - 35;
int table_origin_x = 100;
int table_origin_y = 95;
int element_height = 100;
int element_width = 100;
int element_vert_sep = 10;
int element_horiz_sep = 10;
int centre_box_x = table_origin_x + (element_width * 2) + fudge;
int centre_box_y = table_origin_y + (element_height * 2) + fudge;
int centre_box_width = 380;
int centre_box_height = 300 - fudge;
int legend_x = centre_box_x + (centre_box_width/2) - 35;
int legend_y = centre_box_y - 160;
void quit_app(caddr_t)
{
exit(0);
}
void change_sel(GnSingleSelection *client_data, caddr_t call_data)
{
GnSingleSelection *sel = (GnSingleSelection *)call_data;
client_data->Select(sel->SelectedItem(), False);
}
void set_og_value(GnSelection *sel, GnPresentable *obj, caddr_t)
{
sel->Select(obj, True);
}
void ShowCurrentAndHistory(caddr_t call_data)
{
GnSingleSelection *sel = (GnSingleSelection *)call_data;
cerr << "Selected Item = ";
if( sel->SelectionAvailable() )
cerr << (void *)sel->SelectedItem();
else
cerr << "NIL";
cerr << " History = ";
if( sel->HistoryAvailable() )
cerr << (void *)sel->History();
else
cerr << "NIL";
cerr << "\n";
cerr.flush();
}
void RemoveSelection(GnSingleSelection *selection, caddr_t)
{
if( selection->SelectionAvailable() )
selection->Remove(selection->SelectedItem());
ShowCurrentAndHistory((caddr_t)selection);
ENSURE( ! selection->SelectionAvailable(), "No selected item");
}
void ShowClasses(GnSingleSelection *selection, caddr_t)
{
GnClassListIterator *it = GnClass::ClassListIterator();
GnPresentableList new_items;
for( it->Start(); ! it->Off(); it->Forth() )
new_items.Append(new GnStringItem(strdup(it->Item()->Name())));
selection->SetItemList(&new_items);
}
void call_manage(GnFormDialog *dialog, caddr_t)
{
dialog->manage();
}
void call_play(char *file, caddr_t)
{
char s[200];
sprintf(s, "/usr/demo/SOUND/play %s", file);
system(s);
}
void fsb_dialog(GnWidget *parent, caddr_t)
{
GnPathname *outp;
if( select_old_file(*parent, &outp) == OK ) {
cout << "You selected: " << outp->abs_namestring() << endl;
delete outp;
}
}
void postmenu(void *client_data, caddr_t call_data)
{
GnPopupMenuPane *menu = (GnPopupMenuPane *)client_data;
XEvent *event = (XEvent *)call_data;
if( event->xbutton.button != Button3 )
return;
menu->MenuPosition(event);
menu->manage();
}
void set_dialog_args(GnMessageBox &dialog)
{
dialog.setR_marginWidth(3);
dialog.setR_marginHeight(3);
dialog.setR_labelFontList(dialog_font);
dialog.setR_textFontList(newcenturyschlbk_roman12);
dialog.setR_shadowThickness(1);
}
GnForm & make_element(GnWidget &parent, Position x, Position y, char *lbl,
char *name, GnPushButton **button_ret = 0,
Dimension el_width = element_width,
Dimension el_height = element_height)
{
GnFrame &frame = *new GnFrame;
frame.setR_x(x);
frame.setR_y(y);
frame.create(parent, "frame");
GnForm &form = *new GnForm;
form.setR_width(el_width);
form.setR_height(el_height);
form.create(frame, "form");
GnLabel &label = *new GnLabel(lbl);
label.setR_fontList(newcenturyschlbk_roman14);
label.setR_shadowThickness(1);
label.setR_rightAttachment(XmATTACH_FORM);
label.setR_topAttachment(XmATTACH_FORM);
label.create(form, "label");
GnPushButton &button = *new GnPushButton(name);
button.setR_fontList(newcenturyschlbk_roman14);
button.setR_shadowThickness(1);
button.setR_alignment(XmALIGNMENT_CENTER);
button.setR_leftAttachment(XmATTACH_FORM);
button.setR_bottomAttachment(XmATTACH_FORM);
button.setR_rightAttachment(XmATTACH_FORM);
button.create(form, "button");
if(button_ret)
*button_ret = &button;
return form;
}
int main(Cardinal argc, char **argv)
{
if( ! GnClass::IsInitialized() )
GnClass::Initialize();
GnPushButton *dialog_parent;
GnToolkit toolkit("Perf");
toolkit.AppShell().setR_allowShellResize(True);
toolkit.AppShell().setR_deleteResponse(XmDO_NOTHING);
toolkit.AppInitialize(&argc, argv);
toolkit.set_xt_error_handler((XtErrorHandler)abort);
//toolkit.set_xt_warning_handler((XtErrorHandler)abort);
toolkit.AppShell().add_wm_closed_callback(SIMPLE_CALLBACK(quit_app));
GnVariableMainWindow main_window;
main_window.setR_width(1000);
main_window.setR_height(802);
//main_window.setR_scrollingPolicy(XmAUTOMATIC);
main_window.create(toolkit.AppShell(), "main_window");
GnMenuBar menu_bar_1;
menu_bar_1.create(main_window, "menu_bar_1");
GnBulletinBoard work_area;
//work_area.setR_width(500);
//work_area.setR_height(500);
work_area.setR_borderWidth(2);
work_area.setR_labelFontList(hel_bold_font);
work_area.create(main_window, "work_area");
GnRowColumn title_column;
title_column.setR_x(270);
title_column.setR_y(25);
title_column.setR_orientation(XmVERTICAL);
title_column.setR_entryAlignment(XmALIGNMENT_CENTER);
title_column.create(work_area, "title_column");
GnLabelGadget title_version("Beta Version");
title_version.setR_fontList(newcenturyschlbk_roman12);
title_version.create(title_column, "title_version");
GnLabelGadget title_1("The Periodic Table of C++ Widgets");
title_1.setR_fontList(newcenturyschlbk_bold24);
title_1.create(title_column, "title_1");
GnLabelGadget title_2("GMD, March 1991");
title_2.setR_fontList(subtitle_font);
title_2.create(title_column, "title_2");
GnLabelGadget heading_0("*Dialog\nBoxes");
heading_0.setR_x(radioactive_title_x);
heading_0.setR_y(radioactive_title_y);
heading_0.setR_fontList(newcenturyschlbk_roman14);
heading_0.setR_alignment(XmALIGNMENT_END);
heading_0.create(work_area, "heading_0");
GnLabelGadget heading_legend("Key\nTo\nChart");
heading_legend.setR_x(legend_x - 55);
heading_legend.setR_y(legend_y + 15);
heading_legend.setR_fontList(newcenturyschlbk_bold14);
heading_legend.setR_alignment(XmALIGNMENT_END);
heading_legend.create(work_area, "heading_legend");
GnLabelGadget legend_text_1("Atomic Number");
legend_text_1.setR_x(legend_x + 118);
legend_text_1.setR_y(legend_y + 3);
legend_text_1.setR_fontList(newcenturyschlbk_roman12);
legend_text_1.setR_alignment(XmALIGNMENT_CENTER);
legend_text_1.create(work_area, "legend_text_1");
GnLabelGadget legend_text_2("Actual Widget");
legend_text_2.setR_x(legend_x + 118);
legend_text_2.setR_y(legend_y + 33);
legend_text_2.setR_fontList(newcenturyschlbk_roman12);
legend_text_2.setR_alignment(XmALIGNMENT_CENTER);
legend_text_2.create(work_area, "legend_text_2");
GnLabelGadget legend_text_3("Widget Name");
legend_text_3.setR_x(legend_x + 118);
legend_text_3.setR_y(legend_y + 73);
legend_text_3.setR_fontList(newcenturyschlbk_roman12);
legend_text_3.setR_alignment(XmALIGNMENT_CENTER);
legend_text_3.create(work_area, "legend_text_3");
GnLabelGadget legend_arrow_1("_");
legend_arrow_1.setR_x(legend_x + 105);
legend_arrow_1.setR_y(legend_y + 5);
legend_arrow_1.setR_fontList(var_font);
legend_arrow_1.create(work_area, "legend_arrow_1");
GnLabelGadget legend_arrow_2("_");
legend_arrow_2.setR_x(legend_x + 105);
legend_arrow_2.setR_y(legend_y + 35);
legend_arrow_2.setR_fontList(var_font);
legend_arrow_2.create(work_area, "legend_arrow_2");
GnLabelGadget legend_arrow_3("_");
legend_arrow_3.setR_x(legend_x + 105);
legend_arrow_3.setR_y(legend_y + 75);
legend_arrow_3.setR_fontList(var_font);
legend_arrow_3.create(work_area, "legend_arrow_3");
GnSeparator legend_separator;
legend_separator.setR_width(80);
legend_separator.setR_x(10);
legend_separator.setR_y(40);
legend_separator.setR_orientation(XmHORIZONTAL);
legend_separator.setR_shadowThickness(4);
legend_separator.create(make_element(work_area, legend_x, legend_y,
"1", "separator"), "legend_separator");
// Column ONE
GnLabel heading_1("Ia");
heading_1.setR_x(table_origin_x + heading_fudge_x);
heading_1.setR_y(table_origin_y - heading_fudge_y);
heading_1.setR_fontList(heading_font);
heading_1.setR_alignment(XmALIGNMENT_CENTER);
heading_1.create(work_area, "heading_1");
GnSeparator separator_11;
separator_11.setR_width(80);
separator_11.setR_x(10);
separator_11.setR_y(40);
separator_11.setR_orientation(XmHORIZONTAL);
separator_11.setR_shadowThickness(4);
separator_11.create(make_element(work_area, table_origin_x, table_origin_y,
"1", "separator"), "separator_11");
GnArrowButton arrow_12;
arrow_12.setR_x(25);
arrow_12.setR_y(20);
arrow_12.setR_width(50);
arrow_12.setR_height(50);
arrow_12.setR_arrowDirection(XmARROW_UP);
arrow_12.create(make_element(work_area, table_origin_x,
table_origin_y + element_height,
"2", "arrowbutton"), "arrow_12");
GnPushButtonGadget button_13("Explode\nBuilding");
button_13.setR_x(22);
button_13.setR_y(25);
button_13.setR_fontList(hel_bold_font);
button_13.setR_shadowThickness(1);
button_13.create(make_element(work_area, table_origin_x,
table_origin_y + (element_height * 2),
"3", "pushbutton"), "button_13");
button_13.add_activateCallback(SIMPLE_CALLBACK1(call_play, char *,
"/usr/demo/SOUND/sounds/gong.au"));
GnToggleButtonGadget toggle_14("Lights");
toggle_14.setR_x(20);
toggle_14.setR_y(30);
toggle_14.setR_fontList(hel_bold_font);
toggle_14.setR_shadowThickness(1);
toggle_14.create(make_element(work_area, table_origin_x,
table_origin_y + (element_height * 3),
"4", "togglebutton", &dialog_parent),
"toggle_14");
GnFormDialog toggle_14_dialog;
toggle_14_dialog.setR_dialogTitle(GnXMSTRING_LTOR("GnToggleButtonGroup"));
toggle_14_dialog.create(work_area, "toggle_14_dialog");
GnToggleGroup toggle_23;
toggle_23.add("Front", 1, True);
toggle_23.add("Rear", 2, True);
toggle_23.add("Left", 3, False, False);
toggle_23.add("Right", 4);
toggle_23.setR_x(20);
toggle_23.setR_y(4);
toggle_23.setR_spacing(2);
toggle_23.setR_marginHeight(0);
toggle_23.setR_marginWidth(0);
toggle_23.setR_withFrame(False);
toggle_23.create(make_element(toggle_14_dialog, 0, 0,
"4a", "togglegroup", 0, element_width+5,
element_height + 25),
"toggle_23");
dialog_parent->add_activateCallback(SIMPLE_CALLBACK1(call_manage,
GnFormDialog *,
&toggle_14_dialog));
GnLabelGadget label_15("DON'T\nPANIC");
label_15.setR_x(dont_panic_x);
label_15.setR_y(dont_panic_y);
label_15.setR_fontList(times_bold_font);
label_15.create(make_element(work_area, table_origin_x,
table_origin_y + (element_height * 4),
"5", "label"), "label_15");
// Column TWO
GnLabel heading_2("IIa");
heading_2.setR_x(table_origin_x + element_width + heading_fudge_x);
heading_2.setR_y(table_origin_y + element_height - heading_fudge_y);
heading_2.setR_fontList(heading_font);
heading_2.setR_alignment(XmALIGNMENT_CENTER);
heading_2.create(work_area, "heading_2");
// Items for the GnOptionGroup
GnBitmapFilePresentable item_221("xlogo11");
GnStringItem item_222("xlogo16");
GnStringItem item_223("xlogo32");
GnOptionMenu option_22;
option_22.setR_labelString(GnXMSTRING_LTOR("RGB:"));
option_22.setR_x(0);
option_22.setR_y(30);
option_22.setR_shadowThickness(1);
option_22.create(make_element(work_area,
table_origin_x + element_width,
table_origin_y + element_height,
"6", "optionmenu", &dialog_parent),
"option_22");
GnPushButtonGadget option_button_1("bleu");
option_button_1.setR_fontList(fixed_font);
option_button_1.create(option_22, "bleu");
GnPushButtonGadget option_button_2("red");
option_button_2.setR_fontList(fixed_font);
option_button_2.create(option_22, "red");
GnPushButtonGadget option_button_3("green");
option_button_3.setR_fontList(fixed_font);
option_button_3.create(option_22, "green");
GnFormDialog option_22_dialog;
option_22_dialog.setR_dialogTitle(GnXMSTRING_LTOR("GnOptionGroup"));
option_22_dialog.create(work_area, "option_22_dialog");
GnPixmapOptionGroup ob_27;
ob_27.add(&item_221);
ob_27.add(&item_222);
ob_27.add(&item_223);
ob_27.setR_x(0);
ob_27.setR_y(30);
ob_27.setR_shadowThickness(1);
ob_27.setR_labelString(GnXMSTRING_LTOR("Select"));
ob_27.create(make_element(option_22_dialog, 0, 0,
"6a", "optiongroup", 0, 130, 130), "ob_27");
// CALLABCK(GnFormDialog, manage, &option_22_dialog) causes an error:
// "Sorry, not implemented: pointer to non first base"
dialog_parent->add_activateCallback(SIMPLE_CALLBACK1(call_manage,
GnFormDialog *,
&option_22_dialog));
// Callbacks to create the two Option menues/groups
option_button_1.add_activateCallback(SIMPLE_CALLBACK2(set_og_value,
GnSelection *,
&ob_27,
GnPresentable *,
&item_221));
option_button_2.add_activateCallback(SIMPLE_CALLBACK2(set_og_value,
GnSelection *,
&ob_27,
GnPresentable *,
&item_222));
option_button_3.add_activateCallback(SIMPLE_CALLBACK2(set_og_value,
GnSelection *,
&ob_27,
GnPresentable *,
&item_223));
GnScale scale_23;
scale_23.setR_x(3);
scale_23.setR_y(25);
scale_23.setR_width(95);
scale_23.setR_height(50);
scale_23.setR_fontList(hel_bold_font);
scale_23.setR_borderWidth(0);
scale_23.setR_value(42);
scale_23.setR_maximum(42);
scale_23.setR_minimum(0);
scale_23.setR_showValue(True);
scale_23.setR_orientation(XmHORIZONTAL);
scale_23.setR_processingDirection(XmMAX_ON_RIGHT);
scale_23.create(make_element(work_area,
table_origin_x + element_width,
table_origin_y + (element_height * 2),
"7", "scale"), "scale_23");
// The first two objects are added using a linked list
// The third is added using GnSelection::add() with an implicit creation
// of a GnIntegerItem object
GnStringItem item_241("WFNX");
GnStringItem item_242("WCRB");
GnPresentableList olist;
olist.Append(&item_241);
olist.Append(&item_242);
// We use a GnRadioGroup instead of a GnRadioBox here
GnRadioGroup radio_24(False);
radio_24.add(&olist);
GnPresentable *item_243 = radio_24.add("WHKY", 3);
radio_24.setR_x(20);
radio_24.setR_y(4);
radio_24.setR_spacing(2);
radio_24.setR_marginHeight(0);
radio_24.setR_marginWidth(0);
radio_24.setR_withFrame(False);
radio_24.create(make_element(work_area, table_origin_x + element_width,
table_origin_y + (element_height*3),
"8", "radiobox", &dialog_parent),
"radio_24");
GnFormDialog radio_25_dialog;
radio_25_dialog.setR_dialogTitle(GnXMSTRING_LTOR("GnRadioGroup"));
radio_25_dialog.create(work_area, "radio_25_dialog");
// This GnRadioGroup contains the same objects as radio_24
GnRadioGroup radio_25;
radio_25.add(&item_241);
radio_25.add(&item_242);
radio_25.add(item_243);
radio_25.setR_x(20);
radio_25.setR_y(4);
radio_25.setR_spacing(2);
radio_25.setR_marginHeight(0);
radio_25.setR_marginWidth(0);
radio_25.setR_withFrame(True);
radio_25.setR_labelString("SLCT");
radio_25.create(make_element(radio_25_dialog, 0, 0,
"8a", "radiogroup", 0, element_width+5),
"radio_25");
radio_25.add_selectionCallback(SIMPLE_CALLBACK1(change_sel,
GnSingleSelection *,
&radio_24));
radio_24.add_selectionCallback(SIMPLE_CALLBACK1(change_sel,
GnSingleSelection *,
&radio_25));
dialog_parent->add_activateCallback(SIMPLE_CALLBACK1(call_manage,
GnFormDialog *,
&radio_25_dialog));
GnText text_25;
text_25.setR_x(15);
text_25.setR_y(25);
text_25.setR_columns(10);
text_25.setR_rows(2);
text_25.setR_value("helloworld");
text_25.setR_resizeWidth(False);
text_25.setR_resizeHeight(False);
text_25.setR_editMode(XmMULTI_LINE_EDIT);
text_25.create(make_element(work_area, table_origin_x + element_width,
table_origin_y + (element_height*4),
"9", "text edit"), "text_25");
// Center Column
GnLabel heading_center("IIIb");
heading_center.setR_x(centre_box_x + (centre_box_width/2));
heading_center.setR_y(centre_box_y - heading_fudge_y);
heading_center.setR_fontList(heading_font);
heading_center.setR_alignment(XmALIGNMENT_CENTER);
heading_center.create(work_area, "heading_center");
GnFrame fsb_frame;
fsb_frame.setR_x(25);
fsb_frame.setR_y(1);
fsb_frame.create(make_element(work_area, centre_box_x, centre_box_y,
"10", "file selection*", &dialog_parent,
centre_box_width, centre_box_height),
"fsb_frame");
GnFileSelectionBox fsb;
fsb.setR_width(320);
fsb.setR_resizePolicy(XmRESIZE_NONE);
fsb.setR_listVisibleItemCount(2);
fsb.setR_labelFontList(hel_bold_font);
fsb.create(fsb_frame, "fsb");
fsb.add_helpCallback(SIMPLE_CALLBACK1(call_play, char *,
"/usr/demo/SOUND/sounds/laugh.au"));
// Column THREE
GnLabel heading_3("IVa");
heading_3.setR_x(centre_box_x + centre_box_width + heading_fudge_x - 5);
heading_3.setR_y(table_origin_y + (element_height*2)
+ fudge - heading_fudge_y);
heading_3.setR_fontList(heading_font);
heading_3.setR_alignment(XmALIGNMENT_CENTER);
heading_3.create(work_area, "heading_3");
GnScrollBar scrollbar_32;
scrollbar_32.setR_x(10);
scrollbar_32.setR_y(30);
scrollbar_32.setR_width(75);
scrollbar_32.setR_orientation(XmHORIZONTAL);
scrollbar_32.setR_value(20);
scrollbar_32.create(make_element(work_area,
centre_box_x + centre_box_width + fudge,
table_origin_y + (element_height*2)+ fudge,
"11", "scrollbar"), "scrollbar_32");
GnFrame sl_frame_33;
sl_frame_33.setR_x(11);
sl_frame_33.setR_y(12);
sl_frame_33.create(make_element(work_area,
centre_box_x + centre_box_width + fudge,
table_origin_y + (element_height*3),
"12", "scrolled list", &dialog_parent),
"sl_frame_33");
GnScrollableSingleSelectionList scrolled_list_33;
scrolled_list_33.add("Foobar");
scrolled_list_33.add("Mumble");
scrolled_list_33.add("Lambda");
scrolled_list_33.add("Coke");
scrolled_list_33.setR_visibleItemCount(3);
scrolled_list_33.create(sl_frame_33, "scrolled_list_33");
scrolled_list_33.
AddDoubleClickCallback(SIMPLE_CALLBACK(ShowCurrentAndHistory));
GnFormDialog scroll_33_dialog;
scroll_33_dialog.setR_dialogTitle("GnScrollableMultipleSelectionList");
scroll_33_dialog.create(work_area, "scroll_33_dialog");
// This GnRadioGroup contains the same objects as radio_24
GnScrollableMultipleSelectionList scrollable_33;
scrollable_33.add("At");
scrollable_33.add("Bear");
scrollable_33.add("Tilt !");
scrollable_33.add("Pink");
scrollable_33.add("Goose");
scrollable_33.add("Funny");
scrollable_33.setR_visibleItemCount(3);
scrollable_33.create(make_element(scroll_33_dialog, 0, 0,
"12a", "scrollable", 0,
element_width + 5),
"scrollable_33");
dialog_parent->add_activateCallback(SIMPLE_CALLBACK1(call_manage,
GnFormDialog *,
&scroll_33_dialog));
GnFrame paned_frame_34;
paned_frame_34.setR_x(7);
paned_frame_34.setR_y(0);
paned_frame_34.setR_width(100);
paned_frame_34.create(make_element(work_area,
centre_box_x + centre_box_width + fudge,
table_origin_y + (element_height*4),
"16", "paned window",
0, element_width*2),
"paned_frame_34");
GnPanedWindow paned_34;
paned_34.create(paned_frame_34, "paned_34");
GnText paned_text_1;
paned_text_1.setR_columns(24);
paned_text_1.setR_rows(1);
paned_text_1.setR_value("GMD, F3, Project GINA");
paned_text_1.setR_resizeWidth(False);
paned_text_1.setR_resizeHeight(False);
paned_text_1.setR_editMode(XmMULTI_LINE_EDIT);
paned_text_1.create(paned_34, "paned_text_1");
GnText paned_text_2;
paned_text_2.setR_columns(24);
paned_text_2.setR_rows(1);
paned_text_2.setR_value("GINA Beta Version");
paned_text_2.setR_resizeWidth(False);
paned_text_2.setR_resizeHeight(False);
paned_text_2.setR_editMode(XmMULTI_LINE_EDIT);
paned_text_2.create(paned_34, "paned_text_2");
// Column FOUR
GnLabel heading_4("Va");
heading_4.setR_x(centre_box_x + centre_box_width +
element_width + heading_fudge_x);
heading_4.setR_y(table_origin_y + element_height - heading_fudge_y);
heading_4.setR_fontList(heading_font);
heading_4.setR_alignment(XmALIGNMENT_CENTER);
heading_4.create(work_area, "heading_4");
GnFrame frame_41;
frame_41.setR_x(5);
frame_41.setR_y(25);
frame_41.setR_shadowThickness(2);
frame_41.create(make_element(work_area,
centre_box_x + centre_box_width +
element_width + fudge,
table_origin_y + element_height,
"13", "popup menu"), "frame_41");
GnLabel label_41("Press MB3 for\nPopup Menu");
label_41.setR_fontList(fixed_font);
label_41.create(frame_41, "label_41");
// Popup menu is defined after MENU STUFF
GnFrame drawing_area_42_frame;
drawing_area_42_frame.setR_x(26);
drawing_area_42_frame.setR_y(28);
drawing_area_42_frame.create(make_element(work_area,
centre_box_x + centre_box_width +
element_width + fudge,
table_origin_y + (element_height*2),
"14", "drawing area"),
"drawing_area_42_frame");
GnDrawingArea drawing_area_42;
drawing_area_42.setR_width(44);
drawing_area_42.setR_height(36);
drawing_area_42.setR_backgroundPixmap(face_bits, face_width, face_height);
drawing_area_42.create(drawing_area_42_frame, "drawing_area_42");
GnDrawnButton drawn_button_43;
drawn_button_43.setR_x(15);
drawn_button_43.setR_y(10);
drawn_button_43.setR_marginWidth(0);
drawn_button_43.setR_marginHeight(0);
drawn_button_43.setR_width(64);
drawn_button_43.setR_height(62);
drawn_button_43.setR_backgroundPixmap(motif_bitmap_bits, motif_bitmap_width,
motif_bitmap_height);
drawn_button_43.setR_pushButtonEnabled(True);
drawn_button_43.create(make_element(work_area,
centre_box_x + centre_box_width
+ element_width + fudge,
table_origin_y + (element_height*3),
"15", "drawnbutton"),
"drawn_button_43");
// DIALOGS
GnFrame dialog_frame_1;
dialog_frame_1.setR_x(radioactive_x);
dialog_frame_1.setR_y(radioactive_y);
dialog_frame_1.create(work_area, "dialog_frame_1");
GnErrorBox error_dialog;
set_dialog_args(error_dialog);
error_dialog.
setR_messageString(GnXMSTRING_LTOR("Swap Error...\nYou Lose Your Mind."));
error_dialog.create(dialog_frame_1, "error_dialog");
error_dialog.manage();
GnFrame dialog_frame_2;
dialog_frame_2.setR_x(radioactive_x + radioactive_width - 5);
dialog_frame_2.setR_y(radioactive_y);
dialog_frame_2.create(work_area, "dialog_frame_2");
GnInformationBox information_dialog;
set_dialog_args(information_dialog);
information_dialog.setR_messageString(GnXMSTRING_LTOR("Information is\nPower"));
information_dialog.create(dialog_frame_2, "information_dialog");
information_dialog.manage();
GnFrame dialog_frame_3;
dialog_frame_3.setR_x(radioactive_x + (radioactive_width*2) - 15);
dialog_frame_3.setR_y(radioactive_y);
dialog_frame_3.create(work_area, "dialog_frame_3");
GnQuestionBox question_dialog;
set_dialog_args(question_dialog);
question_dialog.
setR_messageString(GnXMSTRING_LTOR("Question authority...\nBut raise your hand first."));
question_dialog.create(dialog_frame_3, "question_dialog");
question_dialog.manage();
GnFrame dialog_frame_4;
dialog_frame_4.setR_x(radioactive_x + (radioactive_width*3) - 25);
dialog_frame_4.setR_y(radioactive_y);
dialog_frame_4.create(work_area, "dialog_frame_4");
GnWarningBox warning_dialog;
set_dialog_args(warning_dialog);
warning_dialog.setR_messageString(GnXMSTRING_LTOR("Warning, Warning,\nDanger, Dr. Smith..."));
warning_dialog.create(dialog_frame_4, "warning_dialog");
warning_dialog.manage();
GnFrame dialog_frame_5;
dialog_frame_5.setR_x(radioactive_x + (radioactive_width*4) - 35);
dialog_frame_5.setR_y(radioactive_y);
dialog_frame_5.create(work_area, "dialog_frame_5");
GnWorkingBox working_dialog;
set_dialog_args(working_dialog);
working_dialog.setR_messageString(GnXMSTRING_LTOR("Work in Progress,\nMeditating...."));
working_dialog.create(dialog_frame_5, "working_dialog");
working_dialog.manage();
// MENU STUFF
GnPulldownMenuPane file_pane;
file_pane.create(menu_bar_1, "filePane");
GnCascadeButton file_cascade("File", file_pane);
file_cascade.setR_fontList(hel_bold_font);
file_cascade.create(menu_bar_1, "fileCascade");
GnPulldownMenuPane edit_pane;
edit_pane.create(menu_bar_1, "editPane");
GnCascadeButton edit_cascade("Edit", edit_pane);
edit_cascade.setR_fontList(hel_bold_font);
edit_cascade.create(menu_bar_1, "editCascade");
GnPulldownMenuPane help_pane;
help_pane.create(menu_bar_1, "helpPane");
GnCascadeButton help_cascade("Help", help_pane);
help_cascade.setR_fontList(hel_bold_font);
help_cascade.create(menu_bar_1, "helpCascade");
menu_bar_1.setR_menuHelpWidget(&help_cascade);
menu_bar_1.SetValues();
// FILE MENU STUFF
GnPushButtonGadget sample_push_button_1("New");
sample_push_button_1.setR_fontList(hel_bold_font);
sample_push_button_1.create(file_pane, "sample_push_button_1");
GnPushButtonGadget sample_push_button_2("Open Software...");
sample_push_button_2.setR_fontList(hel_bold_font);
sample_push_button_2.create(file_pane, "sample_push_button_2");
sample_push_button_2.add_activateCallback(SIMPLE_CALLBACK1(fsb_dialog,
GnWidget *,
&work_area));
GnPulldownMenuPane about_pane;
about_pane.create(file_pane, "about_pane");
GnCascadeButtonGadget about("About", about_pane);
about.setR_fontList(hel_bold_font);
about.create(file_pane, "about");
GnSeparator file_separator;
file_separator.create(file_pane, "file_separator");
GnPushButtonGadget quit_button("Quit");
quit_button.setR_fontList(hel_bold_font);
quit_button.create(file_pane, "quit");
quit_button.add_activateCallback(SIMPLE_CALLBACK(quit_app));
GnLabelGadget about_label("GINA Periodic Table\nBeta Version\
\nCreated by Andreas Baecker\n[April 1991]");
about_label.setR_fontList(hel_bold_font);
about_label.create(about_pane, "about_label");
// EDIT MENU STUFF
GnPushButtonGadget s_push_button_1("Cut");
s_push_button_1.setR_fontList(hel_bold_font);
s_push_button_1.create(edit_pane, "s_push_button_1");
s_push_button_1.add_activateCallback(SIMPLE_CALLBACK1(RemoveSelection,
GnSingleSelection *,
(&scrolled_list_33)));
GnPushButtonGadget s_push_button_2("Copy");
s_push_button_2.setR_fontList(hel_bold_font);
s_push_button_2.create(edit_pane, "s_push_button_2");
GnPushButtonGadget s_push_button_3("Paste");
s_push_button_3.setR_fontList(hel_bold_font);
s_push_button_3.create(edit_pane, "s_push_button_3");
s_push_button_3.add_activateCallback(SIMPLE_CALLBACK1(ShowClasses,
GnSingleSelection *,
(&scrollable_33)));
GnPulldownMenuPane more_stuff_pane;
more_stuff_pane.setR_entryAlignment(XmALIGNMENT_CENTER);
more_stuff_pane.create(edit_pane, "more_stuff_pane");
GnCascadeButtonGadget morestuff("morestuff", more_stuff_pane);
morestuff.setR_fontList(hel_bold_font);
morestuff.create(edit_pane, "morestuff");
GnLabelGadget more_stuff_label("THANKS FOR\nALL THE FISH");
more_stuff_label.setR_fontList(hel_bold_font);
more_stuff_label.create(more_stuff_pane, "more_stuff_label");
// HELP MENU STUFF
GnPushButtonGadget overview("Overview...");
overview.setR_fontList(hel_bold_font);
overview.create(help_pane, "overview");
GnPushButtonGadget bindings("Bindings...");
bindings.setR_fontList(hel_bold_font);
bindings.create(help_pane, "bindings");
GnPushButtonGadget tutorial("Tutorial...");
tutorial.setR_fontList(hel_bold_font);
tutorial.create(help_pane, "tutorial");
GnPushButtonGadget DumpOn("Dump Tree");
DumpOn.create(file_pane, "DumpOn");
DumpOn.add_activateCallback(CALLBACK1(GnWidget, dump_tree,
&toolkit.AppShell(), int, 0));
// POPUP MENU FOR label_41
GnPopupMenuPane popup_41;
popup_41.create(label_41, "popup_41");
label_41.add_event_handler(SIMPLE_CALLBACK1(postmenu,
GnPopupMenuPane*, &popup_41),
ButtonPressMask);
GnLabelGadget popup_label_41("POPUP MENU");
popup_label_41.create(popup_41, "popup_label_41");
GnSeparatorGadget popup_separator_41;
popup_separator_41.setR_separatorType(XmDOUBLE_LINE);
popup_separator_41.create(popup_41, "popup_label_41");
GnPushButtonGadget popup_push_41("pushbutton");
popup_push_41.create(popup_41, "popup_push_41");
GnToggleButtonGadget popup_toggle_41("togglebutton");
popup_toggle_41.create(popup_41, "popup_toggle_41");
toolkit.AppShell().realize();
toolkit.AppMainLoop();
}