本文整理匯總了Golang中github.com/lxn/walk.FileDialog.ShowBrowseFolder方法的典型用法代碼示例。如果您正苦於以下問題:Golang FileDialog.ShowBrowseFolder方法的具體用法?Golang FileDialog.ShowBrowseFolder怎麽用?Golang FileDialog.ShowBrowseFolder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/lxn/walk.FileDialog
的用法示例。
在下文中一共展示了FileDialog.ShowBrowseFolder方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: CreateVersion_Triggered
/**
*添加版本的方法
*/
func CreateVersion_Triggered(owner walk.Form, model *xorm.VersionModel) {
var dlg *walk.Dialog
var db *walk.DataBinder
var dph *walk.LineEdit
var ep walk.ErrorPresenter
var version = new(xorm.Version)
var acceptPB, cancelPB *walk.PushButton
var dialog = Dialog{}
dialog.AssignTo = &dlg
dialog.Title = "創建版本"
dialog.DataBinder = DataBinder{
AssignTo: &db,
DataSource: version,
ErrorPresenter: ErrorPresenterRef{&ep},
}
dialog.MinSize = Size{300, 200}
dialog.Layout = VBox{}
dialog.DefaultButton = &acceptPB
dialog.CancelButton = &cancelPB
dirPath := LineEdit{
AssignTo: &dph,
Text: Bind("Path"),
ReadOnly: true,
}
childrens := []Widget{
Composite{
Layout: Grid{Columns: 5},
Children: []Widget{
Label{
Text: "工程:",
MinSize: Size{42, 0},
},
ComboBox{
MinSize: Size{108, 0},
Value: Bind("ProjectName", SelRequired{}),
BindingMember: "Key",
DisplayMember: "Name",
Model: xorm.FindAllProjDataCombox(),
},
dirPath,
PushButton{
Text: "選擇版本",
OnClicked: func() {
filDlg := new(walk.FileDialog)
filDlg.ShowBrowseFolder(owner)
dph.SetText(filDlg.FilePath)
},
},
},
},
Composite{
Layout: Grid{Columns: 2},
Children: []Widget{
Label{
Text: "名稱:",
},
LineEdit{
Text: Bind("Name"),
MaxLength: 10,
},
Label{
Text: "創建者:",
},
LineEdit{
Text: Bind("CreateUser"),
MaxLength: 10,
},
Label{
Text: "描述:",
},
TextEdit{
Text: Bind("Desc"),
MinSize: Size{300, 50},
},
LineErrorPresenter{
AssignTo: &ep,
ColumnSpan: 2,
},
},
},
Composite{
Layout: HBox{},
Children: []Widget{
HSpacer{},
PushButton{
AssignTo: &acceptPB,
Text: "保存",
OnClicked: func() {
if err := db.Submit(); err != nil {
log.Print(err)
return
}
xorm.SaveVersionByParam(version.Name, version.CreateUser, version.Desc)
model.ResetRows()
dlg.Accept()
//.........這裏部分代碼省略.........