dialog

Used to create a modal dialog interface.


xshade
dialog

List of Methods

append_bool Appends a boolean item
append_bool_deprecated Appends a boolean item (old)
append_custom Appends a custom item
append_default_button Appends a default button
append_double Appends a double precision floating point item
append_double_deprecated Appends a double precision floating point item (old)
append_float Appends a single precision floating point item
append_float_deprecated Appends a single precision floating point item (old)
append_int Appends an integer item
append_int_deprecated Appends an integer item (old)
append_path Appends an item which obtains the file path
append_push_button Appends a push button item
append_push_button_deprecated Appends a push button item (old)
append_radio_button Appends a radio button item
append_reset_button Appends a reset button
append_rgb Appends an rgb item
append_secure_short_string Appends a short string item for a password
append_secure_string Appends a string item for a password
append_selection Appends a selection item
append_selection_deprecated Appends a selection item (old)
append_short_string Appends a short string item
append_string Appends a string item
append_string_deprecated Appends a string item (old)
append_text Appends a text item
append_text_deprecated Appends a text item (old)
append_vec2 Appends a vec2 item
append_vec3 Appends a vec3 item
ask Displays a dialog box
ask_path Displays a file selection dialog box and obtains the path
begin_box Begins a box
begin_group Begins a group
begin_group_deprecated Begins a group (old)
begin_tab_group Begins a tab group
end_box Ends the box
end_group Ends the group
end_tab_group Ends the tab group
get_property_id Returns the property ID of the specified index number
get_property_type Returns the property type of the specified index number
get_value Returns the value of the specified property
separator The separator character used in the selection item
set_default_value Sets the default value of the specified property
set_value Sets the value of the specified property

List of Properties

dialog_id The ID set with xshade.create_dialog()




Creates an instance similar to dialog = xshade.create_dialog_with_uuid()
See also :
 xshade.create_dialog_with_uuid

#basic structure
dialog = xshade.create_dialog_with_uuid()
idx = dialog.append_bool('sample')
if dialog.ask('sample_dialog'):
	r_idx = dialog.get_value(idx)

Method Details

append_bool

Appends a boolean item.
Return value :
  int
Arguments :
  string : name

idx = dialog.append_bool('sample')

append_bool_deprecated

Appends a boolean item (old).
Return value :
  int
Arguments :
  string : name
Due to changes to Shade's internal dialog interface, old fucntions which create the same items are appended with "_deprecated".

idx = dialog.append_bool_deprecated('sample')

append_custom

Appends a custom item.
Arguments :
  size
It is possible to reserve white space with scripts.

#appends (100,10) area (of white space)
idx = dialog.append_custom((100,10))

append_default_button

Appends a default button.
Returns the default settings value of the dialog.
See also :
  set_default_value

dialog.append_default_button()

append_double

Appends a double precision floating point item.
Return value :
  Value
Arguments :
  string : name
Arguments :
  string : unit : optional

idx = dialog.append_double('sample','unit')

append_double_deprecated

Appends a double precision floating point item (old).
Return value :
  Value
Arguments :
  string : name
Arguments :
  string : unit : optional
Due to changes to Shade's internal dialog interface, old fucntions which create the same items are appended with "_deprecated".

idx = dialog.append_double_deprecated('sample','unit')

append_float

Appends a single precision floating point item.
Return value :
  Value
Arguments :
  string : name
Arguments :
  string : unit : optional

idx = dialog.append_float('sample','unit')

append_float_deprecated

Appends a single precision floating point item (old).
Return value :
  Value
Arguments :
  string : name
Arguments :
  string : unit : optional
Due to changes to Shade's internal dialog interface, old fucntions which create the same items are appended with "_deprecated"

idx = dialog.append_float_deprecated('sample','unit')

append_int

Appends an integer item.
Return value :
  int
Arguments :
  string : name
Arguments :
  string : unit : optional

idx = dialog.append_int('sample','unit')

append_int_deprecated

Appends an integer item (old).
Return value :
  int
Arguments :
  string : name
Arguments :
  string : unit : optional
Due to changes to Shade's internal dialog interface, old fucntions which create the same items are appended with "_deprecated"

idx = dialog.append_int_deprecated('sample','unit')

append_path

Appends an item which obtains the file path.
Return value :
  string : file_path
Arguments :
  string : text box title
Arguments :
  bool : folder selectable : optional, True if omitted
Arguments :
  bool : file selectable : optional, True if omitted
The second and third arguments are currently Mac only.
In Windows, folder selection only.

idx = dialog.append_path('sample')

append_push_button

Appends a push button item.
Arguments :
  string : string displayed on the button
Only displays the button; actions cannot be assigned.

idx = dialog.append_push_button('sample')

append_push_button_deprecated

Appends a push button item (old).
Arguments :
  string : string displayed on the button
Only displays the button; actions cannot be assigned.
Due to changes to Shade's internal dialog interface, old fucntions which create the same items are appended with "_deprecated"

idx = dialog.append_push_button_deprecated('sample')

append_radio_button

Appends a radio button item.
Return value :
  int
Arguments :
  string : name

idx = dialog.append_radio_button('sample/item1/item2/item3')

append_reset_button

Appends a reset button.
Returns the settings value at the time the dialog is opened.

dialog.append_reset_button()

append_rgb

Appends an rgb item.
Return value :
  rgb
Arguments :
  string : name
Arguments :
  string : unit : optional

idx = dialog.append_rgb('sample','unit')

append_secure_short_string

Appends a short string item for a password.
Return value :
  string
Arguments :
  string : name
Arguments :
  string : unit : optional

idx = dialog.append_secure_short_string('sample','unit')

append_secure_string

Appends a string item for a password.
Return value :
  string
Arguments :
  string : name
Arguments :
  string : unit : optional

idx = dialog.append_secure_string('sample','unit')

append_selection

Appends a selection item.
Return value :
  int
Arguments :
  string : name
Arguments :
  string : unit : optional
See also :
  separator
Strings are separated by the separator character.
The default separator character is '/'

idx = dialog.append_selection('sample/item/item/item','unit')

append_selection_deprecated

Appends a selection item (old).
Return value :
  int
Arguments :
  string : name
Arguments :
  string : unit : optional
See also :
  separator
Strings are separated by the separator character.
The default separator character is '/'
Due to changes to Shade's internal dialog interface, old fucntions which create the same items are appended with "_deprecated".

idx = dialog.append_selection_deprecated('sample/item/item/item','unit')

append_short_string

Appends a short string item.
Return value :
  string
Arguments :
  string : name
Arguments :
  string : unit : optional

idx =dialog.append_short_string('sample','unit')

append_string

Appends a string item.
Return value :
  string
Arguments :
  string : name
Arguments :
  string : unit : optional

idx = dialog.append_string('sample','unit')

append_string_deprecated

Appends a string item.
Return value :
  string
Arguments :
  string : name
Arguments :
  string : unit : optional
Due to changes to Shade's internal dialog interface, old fucntions which create the same items are appended with "_deprecated".

idx = dialog.append_string_deprecated('sample','unit')

append_text

Appends a text item.
Return value :
  string
Arguments :
  string : name
Arguments :
  int : number of lines optional 6 lines when omitted

idx = dialog.append_text('sample',4)

append_text_deprecated

Appends a text item.
Return value :
  string
Arguments :
  string : name
Arguments :
  int : number of lines optional 6 lines when omitted
Due to changes to Shade's internal dialog interface, old fucntions which create the same items are appended with "_deprecated".

idx = dialog.append_text_deprecated('sample',4)

append_vec2

Appends a vec2 item.
Return value :
  vec2
Arguments :
  string : name
Arguments :
  string : unit : optional

idx = dialog.append_vec2('string','unit') 

append_vec3

Appends a vec3 item.
Return value :
  vec3
Arguments :
  string : name
Arguments :
  string : unit : optional

idx = dialog.append_vec3('string','unit')

ask

Displays a dialog box.
Return value :
  bool
Arguments :
  string : dialog title : optional

dialog.ask()

ask_path

Displays a file selection dialog box and returns the path.
Return value :
  file_path
Arguments :
  bool : True : open, False : save
Arguments :
  string : name | extension1; extension2. multiple strings possible using the | separator

dialog = xshade.create_dialog()
#Open
tmp_path = dialog.ask_path(True, "Jpeg(.jpg.jpeg)|jpg;jpeg|Gif(.gif)|gif")
print tmp_path
#Save
tmp_path = dialog.ask_path(False, "Jpeg(.jpg)|jpg|Gif(.gif)|gif")
print tmp_path

begin_box

Begins a box.
Arguments :
  bool : True : vertical placement, False : horizontal placement
Use together with end_box()

dialog.begin_box()

begin_group

Begins a group.
Arguments :
  string : group name
Use together with end_group().

dialog.begin_group('string')

begin_group_deprecated

Begins a group.
Arguments :
  string : group name
Use together with end_group()
Due to changes to Shade's internal dialog interface, old fucntions which create the same items are appended with "_deprecated".

dialog.begin_group_deprecated('string')

begin_tab_group

Begins a tab group.
Arguments :
  string : tabe group name
Use together with end_tab_group().

dialog.begin_tab_group('sample')

end_box

Ends a box.
Use together with begin_box().

dialog.end_box()

end_group

Ends a group.
Use together with begin_group().

dialog.end_group()

end_tab_group

Ends a tab group.
Use together with begin_tab_group().

dialog.end_tab_group()

get_property_id

Returns the property ID of the specified index number.
Return value :
  int
Arguments :
  int : property index

print dialog.get_property_id(idx)

get_property_type

Returns the property type of the specified index number.
Return value :
  Value
Arguments :
  int : property index
Property Type :

1bool
2selection
3int
4float
5vec3
6rgb
7string
8double
9group begin
10group end
11short string
12text
13rgba
14window
15tag group begin
16tag group end
17vec2
18vec4
19quaternion
20mat4
21hbox begin
22vbox begin
23box end
24custom
25progress
26listbox
27push button
28secure string
29secure short string
30path
31radio button
print dialog.get_property_type(idx)

get_value

Returns the value of the specified property.
See also :
  set_value

res = dialog.get_value(idx)

separator

Type : string The separator character used in the selection item.
The default is '/'

#Change the separator charactor to '|'
dialog.separator = '|'

set_default_value

Sets the default value of the specified property.
Arguments :
  int : property index number
Arguments :
  Python object : default value of each item

dialog.set_default_value(idx, False)

set_value

Sets the value of the specified property.
Arguments :
  int : property index number
Arguments :
  Python object : value of each item
See also :
  get_value

dialog.set_value(idx, False)

Property Details

dialog_id

the ID set with xshade.create_dialog()

  • Get
  • Set

Return value :
  int

print dialog.dialog_id