4
%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
4
%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
6
6
%% The contents of this file are subject to the Erlang Public License,
7
7
%% Version 1.1, (the "License"); you may not use this file except in
81
81
{pack_x, 2}, {pack_y, 3},
82
82
{selectmode, multiple}]),
84
%% Add Ok and Cancel buttons
85
{Wbtn, Hbtn} = dbg_ui_win:min_size(["Ok","Cancel"], 70, 30),
84
%% Add OK and Cancel buttons
85
{Wbtn, Hbtn} = dbg_ui_win:min_size(["OK","Cancel"], 70, 30),
86
86
Bot = gs:frame(Frm, [{pack_x, {1, 3}}, {pack_y, 4}]),
87
Ok = gs:button(Bot, [{x, Pad}, {y, Pad},
87
OK = gs:button(Bot, [{x, Pad}, {y, Pad},
88
88
{width, Wbtn}, {height, Hbtn},
89
{label, {text,"Ok"}}, {font, Font}]),
89
{label, {text,"OK"}}, {font, Font}]),
90
90
Cancel = gs:button(Bot, [{x, W-Pad-Wbtn}, {y, Pad},
91
91
{width, Wbtn}, {height, Hbtn},
92
92
{label, {text,"Cancel"}}, {font, Font}]),
95
95
gs:config(Win, [{width, Wfrm}, {height, Hfrm}, {map, true}]),
96
96
#winInfo{type=function, win=Win,
97
97
packer=Frm, entries=Entries, trigger=enable,
98
ok=Ok, cancel=Cancel, listbox=Lb, funcs=[]};
98
ok=OK, cancel=Cancel, listbox=Lb, funcs=[]};
99
99
create_win(GS, {X, Y}, Type, Mod, Line) ->
161
161
{align, w}, {group, Grp},
162
162
{data, {trigger, delete}}]),
164
%% Add Ok and Cancel buttons
165
{Wbtn, Hbtn} = dbg_ui_win:min_size(["Ok","Cancel"], 70, 30),
164
%% Add OK and Cancel buttons
165
{Wbtn, Hbtn} = dbg_ui_win:min_size(["OK","Cancel"], 70, 30),
166
166
Ybtn = Yacc + Pad + Hfrm + Pad,
167
Ok = gs:button(Win, [{x, Pad}, {y, Ybtn},
167
OK = gs:button(Win, [{x, Pad}, {y, Ybtn},
168
168
{width, Wbtn}, {height, Hbtn},
169
{label, {text,"Ok"}}, {font, Font}]),
169
{label, {text,"OK"}}, {font, Font}]),
170
170
gs:button(Win, [{x, W-Pad-Wbtn}, {y, Ybtn},
171
171
{width, Wbtn}, {height, Hbtn},
172
172
{label, {text,"Cancel"}}, {font, Font}]),
175
175
gs:config(Win, [{width, W}, {height, Hwin}, {map, true}]),
177
177
#winInfo{type=Type, win=Win,
178
entries=Entries, trigger=enable, ok=Ok}.
178
entries=Entries, trigger=enable, ok=OK}.
180
180
%%--------------------------------------------------------------------
181
181
%% update_functions(WinInfo, Funcs) -> WinInfo
229
229
Key/='Tab', Key/='Return' ->
232
handle_event({gs, LB, click, listbox, ["Ok"]}, WinInfo)
232
handle_event({gs, LB, click, listbox, ["OK"]}, WinInfo)
234
234
handle_event({gs, Ent, keypress, Data, [Key|_]}, WinInfo) ->
235
235
case WinInfo#winInfo.type of
249
249
case next_entry(Ent, WinInfo#winInfo.entries) of
251
251
gs:config(WinInfo#winInfo.ok, flash),
252
handle_event({gs, Ent, click, Data, ["Ok"]}, WinInfo);
252
handle_event({gs, Ent, click, Data, ["OK"]}, WinInfo);
254
254
gs:config(Next, {setfocus, true}),
259
handle_event({gs, _Id, click, _Data, ["Ok"|_]}, WinInfo) ->
259
handle_event({gs, _Id, click, _Data, ["OK"|_]}, WinInfo) ->
260
260
case check_input(WinInfo#winInfo.entries) of
262
262
Data when WinInfo#winInfo.type/=function ->