$PBExportHeader$w_set_window.srw
$PBExportComments$设置窗口控件参数
forward
global type w_set_window from Window
end type
type cb_5 from commandbutton within w_set_window
end type
type cb_4 from commandbutton within w_set_window
end type
type cb_3 from commandbutton within w_set_window
end type
type cb_2 from commandbutton within w_set_window
end type
type cb_1 from commandbutton within w_set_window
end type
type st_1 from statictext within w_set_window
end type
type dw_2 from datawindow within w_set_window
end type
type dw_1 from datawindow within w_set_window
end type
end forward
global type w_set_window from Window
int X=823
int Y=360
int Width=4677
int Height=2776
boolean TitleBar=true
string Title="设置窗口控件参数"
long BackColor=80269524
boolean ControlMenu=true
boolean MinBox=true
boolean MaxBox=true
boolean Resizable=true
cb_5 cb_5
cb_4 cb_4
cb_3 cb_3
cb_2 cb_2
cb_1 cb_1
st_1 st_1
dw_2 dw_2
dw_1 dw_1
end type
global w_set_window w_set_window
type variables
string is_win
end variables
on w_set_window.create
this.cb_5=create cb_5
this.cb_4=create cb_4
this.cb_3=create cb_3
this.cb_2=create cb_2
this.cb_1=create cb_1
this.st_1=create st_1
this.dw_2=create dw_2
this.dw_1=create dw_1
this.Control[]={this.cb_5,&
this.cb_4,&
this.cb_3,&
this.cb_2,&
this.cb_1,&
this.st_1,&
this.dw_2,&
this.dw_1}
end on
on w_set_window.destroy
destroy(this.cb_5)
destroy(this.cb_4)
destroy(this.cb_3)
destroy(this.cb_2)
destroy(this.cb_1)
destroy(this.st_1)
destroy(this.dw_2)
destroy(this.dw_1)
end on
type cb_5 from commandbutton within w_set_window
int X=2802
int Y=2472
int Width=192
int Height=88
int TabOrder=40
string Text="测试"
int TextSize=-11
int Weight=400
string FaceName="宋体"
FontCharSet FontCharSet=GB2312CharSet!
FontPitch FontPitch=Variable!
end type
event clicked;//window win
//win = is_win
//open(win)
//
end event
type cb_4 from commandbutton within w_set_window
int X=2085
int Y=2472
int Width=210
int Height=88
int TabOrder=20
string Text="运算"
int TextSize=-11
int Weight=400
string FaceName="宋体"
FontCharSet FontCharSet=GB2312CharSet!
FontPitch FontPitch=Variable!
end type
event clicked;dw_1.AcceptText()
int li_gl
long ll_num_x, ll_num_y, ll_1, ll_2, ll_num_y0
ll_1 = dw_1.GetRow()
li_gl = dw_1.GetItemNumber(ll_1, "gl_x")
ll_num_y = dw_1.GetItemNumber(ll_1, "num_y_2")
For ll_2 = 1 to 9
li_gl = li_gl - 1
If dw_1.Find("gl_x = " + string(li_gl), 1, dw_1.RowCount()) = 0 Then
Exit
End If
Next
li_gl = li_gl + 1
ll_1 = dw_1.Find("gl_x = " + string(li_gl), 1, dw_1.RowCount())
dw_1.SetITem(ll_1, "num_y_2", ll_num_y)
//messagebox(string(li_gl),string(ll_1))
For ll_2 = 1 To 9
ll_num_x = dw_1.GetItemNumber(ll_1, "num_x_2") + dw_1.GetItemNumber(ll_1, "num_width_2") + dw_1.GetItemNumber(ll_1, "num_gl_x")
ll_num_y0 = dw_1.GetItemNumber(ll_1, "num_y")
li_gl = li_gl + 1
ll_1 = dw_1.Find("gl_x = " + string(li_gl), 1, dw_1.RowCount())
If ll_1 > 0 Then
dw_1.SetItem(ll_1, "num_x_2", ll_num_x)
dw_1.SetITem(ll_1, "num_y_2", ll_num_y - ll_num_y0 + dw_1.GetItemNumber(ll_1, "num_y"))
Else
Exit
End If
Next
end event
type cb_3 from commandbutton within w_set_window
int X=3470
int Y=2472
int Width=192
int Height=88
int TabOrder=50
string Text="退出"
int TextSize=-11
int Weight=400
string FaceName="宋体"
FontCharSet FontCharSet=GB2312CharSet!
FontPitch FontPitch=Variable!
end type
event clicked;Close(Parent)
end event
type cb_2 from commandbutton within w_set_window
int X=3113
int Y=2472
int Width=192
int Height=88
int TabOrder=60
string Text="删除"
int TextSize=-11
int Weight=400
string FaceName="宋体"
FontCharSet FontCharSet=GB2312CharSet!
FontPitch FontPitch=Variable!
end type
event clicked;Delete From z_window Where id_window = :is_win;
If sqlca.sqlcode = 0 Then
Commit;
MessageBox("信息", "删除成功!")
dw_1.Retrieve(is_win)
Else
Rollback;
MessageBox("信息", "删除失败!")
End If
end event
type cb_1 from commandbutton within w_set_window
int X=2473
int Y=2472
int Width=192
int Height=88
int TabOrder=40
string Text="保存"
int TextSize=-11
int Weight=400
string FaceName="宋体"
FontCharSet FontCharSet=GB2312CharSet!
FontPitch FontPitch=Variable!
end type
event clicked;If dw_1.Update() = 1 Then
Commit;
MessageBox("信息", "保存成功!")
Else
Rollback;
MessageBox("信息", "保存失败!")
End If
end event
type st_1 from statictext within w_set_window
int X=809
int Y=2480
int Width=187
int Height=68
boolean Enabled=false
string Text="窗口:"
boolean FocusRectangle=false
long TextColor=33554432
long BackColor=67108864
int TextSize=-11
int Weight=400
string FaceName="宋体"
FontCharSet FontCharSet=GB2312CharSet!
FontPitch FontPitch=Variable!
end type
type dw_2 from datawindow within w_set_window
int X=1015
int Y=2472
int Width=773
int Height=84
int TabOrder=30
string DataObject="dw_gncd"
BorderStyle BorderStyle=StyleLowered!
end type
event itemchanged;dw_2.Accepttext()
is_win = "w" + mid(dw_2.GetItemString(1, 1), 2, 50)
long ll_1 = 0
Select Count(*) Into :ll_1
From z_window
Where id_window = :is_win
and num_x_2 > 0;
If ll_1 = 0 Then
Update z_window Set num_x_2 = Convert(numeric(8, 0), num_x * 1.28),
num_y_2 = Convert(numeric(8, 0), num_y * 1.28),
num_width_2 = num_width, num_height_2 = num_height,
num_weight_2 = num_weight, num_textsize_2 = num_textsize
Where id_window = :is_win;
If sqlca.sqlcode = 0 Then
Update z_window Set num_width_2 = Convert(numeric(8, 0), num_width * 1.28),
num_height_2 = Convert(numeric(8, 0), num_height * 1.28)
Where id_window = :is_win
and id_type = "datawindow!";
End If
If sqlca.sqlcode = 0 Then
Commit;
Else
Rollback;
MessageBox("提示", "计算出现错误!")
End If
End If
dw_1.Retrieve(is_win)
end event
type dw_1 from datawindow within w_set_window
int X=119
int Y=88
int Width=4366
int Height=2280
int TabOrder=10
string DataObject="d_set_window"
BorderStyle BorderStyle=StyleLowered!
boolean HScrollBar=true
boolean VScrollBar=true
boolean HSplitScroll=true
boolean LiveScroll=true
end type
WRadio=ii_ScreenWidth/800 //标准认为屏幕分辨率为800*600
HRadio=ii_ScreenHeight/600//计算出屏幕相对800*600分辨率的变化量
Radio=Min(WRadio,HRadio)
if Radio=1.0 then //if the screen is default 800*600
return Radio