dialog

モーダルダイアログインターフェイスの作成に使用する。


xshade
dialog

メソッド一覧

append_bool 論理値のアイテムを追加する
append_bool_deprecated 論理値のアイテムを追加する(旧)
append_custom カスタムアイテムを追加する
append_default_button デフォルトボタンを追加する
append_double 倍精度浮動小数点値のアイテムを追加する
append_double_deprecated 倍精度浮動小数点値のアイテムを追加する(旧)
append_float 単精度浮動小数点値のアイテムを追加する
append_float_deprecated 単精度浮動小数点値のアイテムを追加する(旧)
append_int 整数値のアイテムを追加する
append_int_deprecated 整数値のアイテムを追加する(旧)
append_path ファイルへのパスを取得するアイテムを追加する
append_push_button プッシュボタンアイテムを追加する
append_push_button_deprecated プッシュボタンアイテムを追加する(旧)
append_radio_button ラジオボタンアイテムを追加する
append_reset_button 復帰ボタンを追加する
append_rgb rgb値のアイテムを追加する
append_secure_short_string パスワード用の短い文字列のアイテムを追加する
append_secure_string パスワード用の文字列のアイテムを追加する
append_selection 選択値のアイテムを追加する
append_selection_deprecated 選択値のアイテムを追加する(旧)
append_short_string 短い文字列のアイテムを追加する
append_string 文字列のアイテムを追加する
append_string_deprecated 文字列のアイテムを追加する(旧)
append_text テキストのアイテムを追加する
append_text_deprecated テキストのアイテムを追加する(旧)
append_vec2 vec2値のアイテムを追加する
append_vec3 vec3値のアイテムを追加する
ask ダイアログボックスを表示する
ask_path ファイル選択ダイアログを表示してパスを取得する
begin_box ボックスを開始する
begin_group グループを開始する
begin_group_deprecated グループを開始する(旧)
begin_tab_group タブグループを開始する
end_box ボックスを終了する
end_group グループを終了する
end_tab_group タブグループを終了する
get_property_id 指定したインデックス番号のプロパティの識別番号を返す
get_property_type 指定したインデックス番号のプロパティのタイプを返す
get_value 指定されたプロパティの値を返す
separator selectionのアイテムで使用されるセパレータ文字
set_default_value 指定されたプロパティのデフォルト値を設定する
set_value 指定されたプロパティの値を設定する

プロパティ一覧

dialog_id xshade.create_dialog()で設定したid




dialog = xshade.create_dialog_with_uuid() のように、インスタンスを作成して使用する。
参照 :
 xshade.create_dialog_with_uuid

#基本構造
dialog = xshade.create_dialog_with_uuid()
idx = dialog.append_bool('sample')
if dialog.ask('sample_dialog'):
	r_idx = dialog.get_value(idx)

メソッド詳細

append_bool

論理値のアイテムを追加する。
戻り値 :
  int
引数 :
  string : 名前

idx = dialog.append_bool('sample')

append_bool_deprecated

論理値のアイテムを追加する(旧)。
戻り値 :
  int
引数 :
  string : 名前
Shade 3D 内部のダイアログインターフェイス変更に伴い、同じアイテムを作成する旧関数に「_deprecated」がつけられたもの。

idx = dialog.append_bool_deprecated('sample')

append_custom

カスタムアイテムを追加する。
引数 :
  size
スクリプトでは領域の確保のみ可能。

#(100,10)の領域(空白)を追加する
idx = dialog.append_custom((100,10))

append_default_button

デフォルトボタンを追加する。
ダイアログのデフォルト設定値に戻す。
参照 :
  set_default_value

dialog.append_default_button()

append_double

倍精度浮動小数点値のアイテムを追加する。
戻り値 :
  数値
引数 :
  string : 名前
引数 :
  string : 単位 : 省略可能

idx = dialog.append_double('sample','単位')

append_double_deprecated

倍精度浮動小数点値のアイテムを追加する(旧)。
戻り値 :
  数値
引数 :
  string : 名前
引数 :
  string : 単位 : 省略可能
Shade 3D 内部のダイアログインターフェイス変更に伴い、同じアイテムを作成する旧関数に「_deprecated」がつけられたもの。

idx = dialog.append_double_deprecated('sample','単位')

append_float

単精度浮動小数点値のアイテムを追加する。
戻り値 :
  数値
引数 :
  string : 名前
引数 :
  string : 単位 : 省略可能

idx = dialog.append_float('sample','単位')

append_float_deprecated

単精度浮動小数点値のアイテムを追加する(旧)。
戻り値 :
  数値
引数 :
  string : 名前
引数 :
  string : 単位 : 省略可能
Shade 3D 内部のダイアログインターフェイス変更に伴い、同じアイテムを作成する旧関数に「_deprecated」がつけられたもの。

idx = dialog.append_float_deprecated('sample','単位')

append_int

整数値のアイテムを追加する。
戻り値 :
  int
引数 :
  string : 名前
引数 :
  string : 単位 : 省略可能

idx = dialog.append_int('sample','単位')

append_int_deprecated

整数値のアイテムを追加する(旧)。
戻り値 :
  int
引数 :
  string : 名前
引数 :
  string : 単位 : 省略可能
Shade 3D 内部のダイアログインターフェイス変更に伴い、同じアイテムを作成する旧関数に「_deprecated」がつけられたもの。

idx = dialog.append_int_deprecated('sample','単位')

append_path

ファイルへのパスを取得するアイテムを追加する。
戻り値 :
  string : file_path
引数 :
  string : テキストボックスのタイトル
引数 :
  bool : フォルダ選択可能 : 省略可能、省略時True
引数 :
  bool : ファイル選択可能 : 省略可能、省略時True
第二、第三引数は現在Macのみ対応。
Windowsではフォルダ選択のみ。

idx = dialog.append_path('sample')

append_push_button

プッシュボタンアイテムを追加する。
引数 :
  string : ボタンに表示する文字列
ボタンの表示のみで、アクションを割り当てる事はできない。

idx = dialog.append_push_button('sample')

append_push_button_deprecated

プッシュボタンアイテムを追加する(旧)。
引数 :
  string : ボタンに表示する文字列
ボタンの表示のみで、アクションを割り当てる事はできない。
Shade 3D 内部のダイアログインターフェイス変更に伴い、同じアイテムを作成する旧関数に「_deprecated」がつけられたもの。

idx = dialog.append_push_button_deprecated('sample')

append_radio_button

ラジオボタンアイテムを追加する。
戻り値 :
  int
引数 :
  string : 名前

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

append_reset_button

復帰ボタンを追加する。
ダイアログが開いた時点での設定値に戻す。

dialog.append_reset_button()

append_rgb

rgb値のアイテムを追加する。
戻り値 :
  rgb
引数 :
  string : 名前
引数 :
  string : 単位 : 省略可能

idx = dialog.append_rgb('sample','単位')

append_secure_short_string

パスワード用の短い文字列のアイテムを追加する。
戻り値 :
  string
引数 :
  string : 名前
引数 :
  string : 単位 : 省略可能

idx = dialog.append_secure_short_string('sample','単位')

append_secure_string

パスワード用の文字列のアイテムを追加する。
戻り値 :
  string
引数 :
  string : 名前
引数 :
  string : 単位 : 省略可能

idx = dialog.append_secure_string('sample','単位')

append_selection

選択値のアイテムを追加する。
戻り値 :
  int
引数 :
  string : 名前
引数 :
  string : 単位 : 省略可能
参照 :
  separator
文字列はセパレータ文字で区切られる。
セパレータ文字のデフォルト値は'/'

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

append_selection_deprecated

選択値のアイテムを追加する(旧)。
戻り値 :
  int
引数 :
  string : 名前
引数 :
  string : 単位 : 省略可能
参照 :
  separator
文字列はセパレータ文字で区切られる。
セパレータ文字のデフォルト値は'/'
Shade 3D 内部のダイアログインターフェイス変更に伴い、同じアイテムを作成する旧関数に「_deprecated」がつけられたもの。

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

append_short_string

短い文字列のアイテムを追加する。
戻り値 :
  string
引数 :
  string : 名前
引数 :
  string : 単位 : 省略可能

idx =dialog.append_short_string('sample','単位')

append_string

文字列のアイテムを追加する。
戻り値 :
  string
引数 :
  string : 名前
引数 :
  string : 単位 : 省略可能

idx = dialog.append_string('sample','単位')

append_string_deprecated

文字列のアイテムを追加する。
戻り値 :
  string
引数 :
  string : 名前
引数 :
  string : 単位 : 省略可能
Shade 3D 内部のダイアログインターフェイス変更に伴い、同じアイテムを作成する旧関数に「_deprecated」がつけられたもの。

idx = dialog.append_string_deprecated('sample','単位')

append_text

テキストのアイテムを追加する。
戻り値 :
  string
引数 :
  string : 名前
引数 :
  int : 行数 省略可能 省略時6行

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

append_text_deprecated

テキストのアイテムを追加する。
戻り値 :
  string
引数 :
  string : 名前
引数 :
  int : 行数 省略可能 省略時6行
Shade 3D 内部のダイアログインターフェイス変更に伴い、同じアイテムを作成する旧関数に「_deprecated」がつけられたもの。

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

append_vec2

vec2値のアイテムを追加する。
戻り値 :
  vec2
引数 :
  string : 名前
引数 :
  string : 単位 : 省略可能

idx = dialog.append_vec2('string','単位') 

append_vec3

vec3値のアイテムを追加する。
戻り値 :
  vec3
引数 :
  string : 名前
引数 :
  string : 単位 : 省略可能

idx = dialog.append_vec3('string','単位')

ask

ダイアログボックスを表示する。
戻り値 :
  bool
引数 :
  string : ダイアログのタイトル : 省略可能

dialog.ask()

ask_path

ファイル選択ダイアログを表示してパスを取得する。
戻り値 :
  file_path
引数 :
  bool : True : 開く、False : 保存
引数 :
  string : 名称|拡張子1;拡張子2。|区切で複数指定可

dialog = xshade.create_dialog()
#開く
tmp_path = dialog.ask_path(True, "Jpeg(.jpg.jpeg)|jpg;jpeg|Gif(.gif)|gif")
print tmp_path
#保存
tmp_path = dialog.ask_path(False, "Jpeg(.jpg)|jpg|Gif(.gif)|gif")
print tmp_path

begin_box

ボックスを開始する。
引数 :
  bool : True : 縦配置、False : 横配置
end_box()とセットで使用する。

dialog.begin_box()

begin_group

グループを開始する。
引数 :
  string : グループの名前
end_group()とセットで使用する。

dialog.begin_group('string')

begin_group_deprecated

グループを開始する。
引数 :
  string : グループの名前
end_group()とセットで使用する。
Shade 3D 内部のダイアログインターフェイス変更に伴い、同じアイテムを作成する旧関数に「_deprecated」がつけられたもの。

dialog.begin_group_deprecated('string')

begin_tab_group

タブグループを開始する。
引数 :
  string : タブグループの名前
end_tab_group()とセットで使用する。

dialog.begin_tab_group('sample')

end_box

ボックスを終了する。
begin_box()とセットで使用する。

dialog.end_box()

end_group

グループを終了する
begin_group()とセットで使用する。

dialog.end_group()

end_tab_group

タブグループを終了する。
begin_tab_group()とセットで使用する。

dialog.end_tab_group()

get_property_id

指定したインデックス番号のプロパティの識別番号を返す。
戻り値 :
  int
引数 :
  int : プロパティのインデックス

print dialog.get_property_id(idx)

get_property_type

指定したインデックス番号のプロパティのタイプを返す。
戻り値 :
  数値
引数 :
  int : プロパティのインデックス
プロパティのタイプ :

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

指定されたプロパティの値を返す。
参照 :
  set_value

res = dialog.get_value(idx)

separator

型 : string selectionのアイテムで使用されるセパレータ文字。
デフォルトは'/'

#セパレータ文字を「|」に変更する
dialog.separator = '|'

set_default_value

指定されたプロパティのデフォルト値を設定する。
引数 :
  int : プロパティのインデックス番号
引数 :
  Pythonオブジェクト : 各アイテムのデフォルトの値

dialog.set_default_value(idx, False)

set_value

指定されたプロパティの値を設定する。
引数 :
  int : プロパティのインデックス番号
引数 :
  Pythonオブジェクト : 各アイテムの値
参照 :
  get_value

dialog.set_value(idx, False)

プロパティ詳細

dialog_id

xshade.create_dialog()で設定したid。

  • 取得
  • 設定

戻り値 :
  int

print dialog.dialog_id