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

📄 fnewmodule.class

📁 Gambas is a graphical development environment based on a Basic interpreter, like Visual Basic. It us
💻 CLASS
字号:
' Gambas class fileSTATIC PUBLIC Name AS StringSTATIC PUBLIC Template AS StringSTATIC PUBLIC Startup AS BooleanPRIVATE selExisting AS FSupSelectorSTATIC PUBLIC FUNCTION Run() AS Boolean  DIM hForm AS FNewModule  Name = Project.GetNewName("Module")  hForm = NEW FNewModule  RETURN NOT hForm.ShowModal()ENDPUBLIC SUB _new()  'ME.Title = "New " & $sType  txtFile.Text = Name  txtFile.Selection(1, txtFile.Length)  txtFile.SetFocus  tabAdd.Index = 1  selExisting = NEW FSupSelector(tabAdd)  selExisting.DialogType = FSupSelector.SHOW_FILE  'selExisting.Root = "/"  selExisting.ShowRootTab = TRUE  selExisting.ShowHomeTab = TRUE  selExisting.ShowProjectTab = TRUE  'selExisting.TreeSequence = "2"  selExisting.Key = "/ExistingFile"  selExisting.Filters = ("Gambas modules") & "|*.module|" & ("Gambas files") & "|*.form,*.module,*.class|" & ("All files") & "|*"  selExisting.Init()  tabAdd.Index = 0  IF NOT Project.Startup THEN    chkStartup.Value = TRUE  ENDIFENDPUBLIC SUB Form_Resize()  selExisting.Move(8, 8, tabAdd.ClientW - 16, tabAdd.ClientH - 16)ENDPUBLIC SUB btnOK_Click()  IF tabAdd.Index = 0 THEN    Name = Trim(txtFile.Text)    IF Project.CheckClassName(Name, TRUE) THEN      txtFile.SetFocus      RETURN    ENDIF    Template = "' Gambas module file\n"    IF chkInit.Value THEN      Template = Template & "\nPUBLIC SUB _init()\n\nEND\n"    ENDIF    IF chkExit.Value THEN      Template = Template & "\nPUBLIC SUB _exit()\n\nEND\n"    ENDIF    Startup = chkStartup.Value    IF chkStartup.Value THEN      Template = Template & "\nPUBLIC SUB Main()\n\nEND\n"    ENDIF    ME.Close(TRUE)  ELSE    IF NOT selExisting.Validate() THEN RETURN    Template = File.Load(selExisting.Path)    Name = File.BaseName(selExisting.Path)    ME.Close(TRUE)  ENDIFENDPUBLIC SUB btnCancel_Click()  ME.CloseEND

⌨️ 快捷键说明

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