dialog box

Bacis2 and API programming
nevio64
Posts: 4
Joined: Mon Jul 01, 2002 1:35 pm

dialog box

Postby nevio64 » Tue Jul 23, 2002 10:33 am

I would to link a button in a tooltray (ui_action_button) with a ui_dialog_box that will contains some buttons.
is there somebody who can give me a simple and clear example?
thanks a lot

geoz
Posts: 7
Joined: Mon Apr 22, 2002 3:00 pm
Location: Woodland, CA
Contact:

dialog box

Postby geoz » Tue Jul 23, 2002 4:44 pm

This example is a stripped-down version.
I hope I didn't remove some critical part.
I didn't include the actual "send" procedure,
its long and a whole other discussion.

George

--This is the button description. Put it in a ".uid" file
coen_get_multiplot_dialog.class:ui_action_button
.activate:coen_multiplot_create_dialog
.parent:user_tooltray
.browse_text:"Plot Multiple Sheets "
.icon:"multiplot"
--------------------------------------------


-- coen_multiplot.bad
-- This is the file containing two Bacis2 procedures.
-- It needs to be compiled in Bacis2 with the commands:
-- compile coen_multiplot.bad
-- library_create_index()

define_constant(!coen_multiplot_create_dialog,
proc(object, attribute)
ui!coen_multiplot_dialog!visible:-true
endproc)

define_constant(!coen_multiplot_close_dialog,
proc(object, attribute)
ui!coen_multiplot_dialog!visible:-false
endproc)
--------------------------------------------


--This is the ".uid" file to describe the dialog box
-- Most of my file has been removed here to fit in the space
coen_multiplot_dialog.class: ui_dialog_box
.title: "Multi-Sheet Plotting"
.layout: coen_multiplot_table
.cancel_button: coen_multiplot_close
.auto_position: false
.x: 400
.y: 200
.parent:main

-- creating table
coen_multiplot_table.class: ui_table
.parent:coen_multiplot_dialog

-- creating a button in the table
coen_multiplot_mechb_button.class: ui_toggle_button
.alternate_label: "Queue mechb"
.standard_state: false
.activate: coen_multiplot_change_queue
.data: "queue_mechb"
.background: .black
.parent:coen_multiplot_table

-- add more buttons in the table here if needed.
-- more tables can be added here, also.

coen_multiplot_close.class: ui_action_button
.label: "Close"
.activate: coen_multiplot_close_dialog
.x: 1
.y: coen_multiplot_table.height
.parent:coen_multiplot_dialog

coen_multiplot_send.class: ui_action_button
.label: "SEND PLOTS"
.activate: coen_multiplot_send_plot
.x: 2
.y: coen_multiplot_table.height
.parent:coen_multiplot_dialog
--------------------------------------------

geoz
Posts: 7
Joined: Mon Apr 22, 2002 3:00 pm
Location: Woodland, CA
Contact:

dialog box

Postby geoz » Tue Jul 23, 2002 5:30 pm

You can run a Bacis2 procedure from the button that actually creates the dialog box and all its components from scratch. Here are a few lines from one of mine. Do a search in your docs for "ui_create_object".

George


-- delete any existing one
if ui_object_field_exists(ui, !library_dialog)
ui_destroy_object(ui!library_dialog)
endif

ui!library_dialog :- ui_create_object(ui!main,
!library_dialog,
!ui_dialog_box)

ui!library_dialog!title:- "Library"

ui!library_dialog!layout:- ui!library_table

ui!library_table :- ui_create_object(ui!library_dialog,
!library_table,
!ui_table)

ui!library_table!width:- 600

ui!library_main_label :- ui_create_object(ui!library_table,
!library_size_label,
!ui_label)

ui!library_main_label!label:- "Use popup Menu for more"

--etc.
--etc.
--etc.

ui!library_dialog!visible:-true


Return to “Bacis2”

Who is online

Users browsing this forum: No registered users and 1 guest

cron