⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 m_main.srm

📁 pb所需编程技巧和事例
💻 SRM
字号:
$PBExportHeader$m_main.srm
forward
global type m_main from menu
end type
type m_file from menu within m_main
end type
type m_- from menu within m_file
end type
type m_exit from menu within m_file
end type
type m_file from menu within m_main
m_- m_-
m_exit m_exit
end type
type m_edit from menu within m_main
end type
type m_modify from menu within m_edit
end type
type m_brow from menu within m_edit
end type
type m_-2 from menu within m_edit
end type
type m_add from menu within m_edit
end type
type m_cls from menu within m_edit
end type
type m_del from menu within m_edit
end type
type m_-0 from menu within m_edit
end type
type m_save from menu within m_edit
end type
type m_giveup from menu within m_edit
end type
type m_edit from menu within m_main
m_modify m_modify
m_brow m_brow
m_-2 m_-2
m_add m_add
m_cls m_cls
m_del m_del
m_-0 m_-0
m_save m_save
m_giveup m_giveup
end type
type m_select from menu within m_main
end type
type m_first from menu within m_select
end type
type m_pro from menu within m_select
end type
type m_next from menu within m_select
end type
type m_last from menu within m_select
end type
type m_select from menu within m_main
m_first m_first
m_pro m_pro
m_next m_next
m_last m_last
end type
type m_help from menu within m_main
end type
type m_关于本软件 from menu within m_help
end type
type m_使用说明 from menu within m_help
end type
type m_help from menu within m_main
m_关于本软件 m_关于本软件
m_使用说明 m_使用说明
end type
global type m_main from menu
m_file m_file
m_edit m_edit
m_select m_select
m_help m_help
end type
end forward

global type m_main from menu
m_file m_file
m_edit m_edit
m_select m_select
m_help m_help
end type
global m_main m_main

on m_main.create
m_main=this
call super::create
this.m_file=create m_file
this.m_edit=create m_edit
this.m_select=create m_select
this.m_help=create m_help
this.Item[UpperBound(this.Item)+1]=this.m_file
this.Item[UpperBound(this.Item)+1]=this.m_edit
this.Item[UpperBound(this.Item)+1]=this.m_select
this.Item[UpperBound(this.Item)+1]=this.m_help
end on

on m_main.destroy
call super::destroy
destroy(this.m_file)
destroy(this.m_edit)
destroy(this.m_select)
destroy(this.m_help)
end on

type m_file from menu within m_main
m_- m_-
m_exit m_exit
end type

on m_file.create
call super::create
this.text = "文 件"
this.m_-=create m_-
this.m_exit=create m_exit
this.Item[UpperBound(this.Item)+1]=this.m_-
this.Item[UpperBound(this.Item)+1]=this.m_exit
end on

on m_file.destroy
call super::destroy
destroy(this.m_-)
destroy(this.m_exit)
end on

type m_- from menu within m_file
end type

on m_-.create
call super::create
this.text = "-"
end on

on m_-.destroy
call super::destroy
end on

type m_exit from menu within m_file
end type

event clicked;
Close(w_main)
end event
on m_exit.create
call super::create
this.text = "退  出~tCtrl+X"
this.shortcut = 344
this.toolbaritemname = "Exit!"
end on

on m_exit.destroy
call super::destroy
end on

type m_edit from menu within m_main
m_modify m_modify
m_brow m_brow
m_-2 m_-2
m_add m_add
m_cls m_cls
m_del m_del
m_-0 m_-0
m_save m_save
m_giveup m_giveup
end type

on m_edit.create
call super::create
this.text = "编 辑"
this.m_modify=create m_modify
this.m_brow=create m_brow
this.m_-2=create m_-2
this.m_add=create m_add
this.m_cls=create m_cls
this.m_del=create m_del
this.m_-0=create m_-0
this.m_save=create m_save
this.m_giveup=create m_giveup
this.Item[UpperBound(this.Item)+1]=this.m_modify
this.Item[UpperBound(this.Item)+1]=this.m_brow
this.Item[UpperBound(this.Item)+1]=this.m_-2
this.Item[UpperBound(this.Item)+1]=this.m_add
this.Item[UpperBound(this.Item)+1]=this.m_cls
this.Item[UpperBound(this.Item)+1]=this.m_del
this.Item[UpperBound(this.Item)+1]=this.m_-0
this.Item[UpperBound(this.Item)+1]=this.m_save
this.Item[UpperBound(this.Item)+1]=this.m_giveup
end on

on m_edit.destroy
call super::destroy
destroy(this.m_modify)
destroy(this.m_brow)
destroy(this.m_-2)
destroy(this.m_add)
destroy(this.m_cls)
destroy(this.m_del)
destroy(this.m_-0)
destroy(this.m_save)
destroy(this.m_giveup)
end on

type m_modify from menu within m_edit
end type

on m_modify.create
call super::create
this.text = "执行编 辑"
this.toolbaritemname = "Custom072!"
end on

event clicked;This.Enabled = False
m_brow.Enabled = True
m_del.Enabled = True
m_add.Enabled = True
m_save.Enabled = True
m_giveup.Enabled = True
m_save.Enabled=true


end event

on m_modify.destroy
call super::destroy
end on

type m_brow from menu within m_edit
end type

on m_brow.create
call super::create
this.text = "浏 览"
this.enabled = false
this.toolbaritemname = "Browse!"
end on

event clicked;This.Enabled = False
m_modify.Enabled = True
m_del.Enabled = False
m_add.Enabled = False
m_save.Enabled = False
m_giveup.Enabled = False



end event
on m_brow.destroy
call super::destroy
end on

type m_-2 from menu within m_edit
end type

on m_-2.create
call super::create
this.text = "-"
end on

on m_-2.destroy
call super::destroy
end on

type m_add from menu within m_edit
end type

on m_add.create
call super::create
this.text = "添 加~tCtrl+Alt+I"
this.enabled = false
this.shortcut = 841
this.toolbaritemname = "Insert5!"
end on

event clicked;long ll_newrow
ll_newrow = w_main.dw_1.InsertRow(0)
w_main.dw_1.ScrollToRow(ll_newrow)
newrow=ll_newrow
//将垂直滑动条移至最大处
any max
max=w_main.dw_1.object.datawindow.VerticalScrollMaximum
w_main.dw_1.object.datawindow.verticalscrollposition= max
//将水平滑动条移至最小处
w_main.dw_1.object.DataWindow.HorizontalScrollPosition = 0
w_main.dw_1.SetFocus()



end event
on m_add.destroy
call super::destroy
end on

type m_cls from menu within m_edit
end type

on m_cls.create
call super::create
this.text = "清除添加时的设置"
this.enabled = false
this.toolbaritemname = "Asterisk!"
end on

on m_cls.destroy
call super::destroy
end on

event clicked;int i,columns 
insertflag=0
columns=integer(w_main.dw_1.Object.DataWindow.Column.Count)//列数
for i=2 to columns
  w_main.dw_1.settaborder(i,50+i)
  w_main.dw_1.modify("#"+string(i)+".update=yes")
next
end event
type m_del from menu within m_edit
end type

on m_del.create
call super::create
this.text = "删 除~tCtrl+Del"
this.enabled = false
this.shortcut = 302
this.toolbaritemname = "Clear!"
end on

event clicked;Messagebox(" ",w_main.dw_1.getitemstring(w_main.dw_1.getrow(),2) )
Int li_net
li_net = MessageBox("提示"," 确实要删除该条记录吗?",Question!, YesNo!)
If li_net = 1 Then
	w_main.dw_1.deleterow(0)
End if
w_main.dw_1.update()
commit using sqlca;
end event
on m_del.destroy
call super::destroy
end on

type m_-0 from menu within m_edit
end type

on m_-0.create
call super::create
this.text = "-"
end on

on m_-0.destroy
call super::destroy
end on

type m_save from menu within m_edit
event clicked ( )
event create ( )
event destroy ( )
end type

event clicked;w_main.dw_1.Accepttext()
if w_main.dw_1.Update() = 1 then	
	commit;
	MessageBox("提示:","已经保存!")
end if
w_main.dw_1.retrieve()
end event
on m_save.create
call super::create
this.text = "保 存~tCtrl+S"
this.enabled = false
this.shortcut = 339
this.toolbaritemname = "Save!"
end on

on m_save.destroy
call super::destroy
end on

type m_giveup from menu within m_edit
event clicked ( )
event create ( )
event destroy ( )
end type

event clicked;rollback using sqlca;
w_main.dw_1.Retrieve()

end event
on m_giveup.create
call super::create
this.text = "放 弃~tCtrl+X"
this.enabled = false
this.shortcut = 344
this.toolbaritemname = "Redo!"
end on

on m_giveup.destroy
call super::destroy
end on

type m_select from menu within m_main
m_first m_first
m_pro m_pro
m_next m_next
m_last m_last
end type

on m_select.create
call super::create
this.text = "选 择"
this.m_first=create m_first
this.m_pro=create m_pro
this.m_next=create m_next
this.m_last=create m_last
this.Item[UpperBound(this.Item)+1]=this.m_first
this.Item[UpperBound(this.Item)+1]=this.m_pro
this.Item[UpperBound(this.Item)+1]=this.m_next
this.Item[UpperBound(this.Item)+1]=this.m_last
end on

on m_select.destroy
call super::destroy
destroy(this.m_first)
destroy(this.m_pro)
destroy(this.m_next)
destroy(this.m_last)
end on

type m_first from menu within m_select
end type

on m_first.create
call super::create
this.text = "第一页"
this.toolbaritemname = "VCRFirst!"
this.toolbaritemtext = "第一条"
end on

event clicked;w_main.dw_1.scrolltorow(1)
end event
on m_first.destroy
call super::destroy
end on

type m_pro from menu within m_select
end type

on m_pro.create
call super::create
this.text = "上一页"
this.toolbaritemname = "VCRPrior!"
this.toolbaritemtext = "上一条"
end on

event clicked;w_main.dw_1.scrollpriorpage()
end event
on m_pro.destroy
call super::destroy
end on

type m_next from menu within m_select
end type

on m_next.create
call super::create
this.text = "下一页"
this.toolbaritemname = "VCRNext!"
this.toolbaritemtext = "下一条"
end on

event clicked;w_main.dw_1.scrollnextpage()
end event
on m_next.destroy
call super::destroy
end on

type m_last from menu within m_select
end type

on m_last.create
call super::create
this.text = "最后一页"
this.toolbaritemname = "VCRLast!"
this.toolbaritemtext = "最后一条"
end on

event clicked;long ll_rowcount
ll_rowcount = w_main.dw_1.rowcount()
w_main.dw_1.scrolltorow(ll_rowcount)

end event
on m_last.destroy
call super::destroy
end on

type m_help from menu within m_main
m_关于本软件 m_关于本软件
m_使用说明 m_使用说明
event create ( )
event destroy ( )
end type

on m_help.create
call super::create
this.text = "Help"
this.m_关于本软件=create m_关于本软件
this.m_使用说明=create m_使用说明
this.Item[UpperBound(this.Item)+1]=this.m_关于本软件
this.Item[UpperBound(this.Item)+1]=this.m_使用说明
end on

on m_help.destroy
call super::destroy
destroy(this.m_关于本软件)
destroy(this.m_使用说明)
end on

type m_关于本软件 from menu within m_help
event create ( )
event destroy ( )
end type

on m_关于本软件.create
call super::create
this.text = "关于本软件"
end on

on m_关于本软件.destroy
call super::destroy
end on

event clicked;//open(w_product)
end event

type m_使用说明 from menu within m_help
event create ( )
event destroy ( )
end type

on m_使用说明.create
call super::create
this.text = "使用说明"
end on

on m_使用说明.destroy
call super::destroy
end on

event clicked;string help
help="<<  使用者务必了解:>>~n"+&
     "1.数据表的编辑(增加,删除,修改)必须点中编辑菜单的执行编辑~n"+&
	  "2.对数据进行编辑(增加,删除,修改)后必须保存方能有效~n"+&
     "3.多行编辑框中输入时如要回车,请按Ctrl+Enter  "
MessageBox("使用说明:",help)
end event

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -