Guidance
指路人
g.yi.org
software / rapidq / Examples / Tools - IDE, Designer, Builder / FreeQ IDE src / inc ide / IDE_Dialogs.inc

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
'==================================================================================
'           General forms for all modules
'==================================================================================

     CREATE gDialogForm AS QFORM
      CAPTION = ""
      Width = 270
      Height = 103
      Center
      CREATE gDialogLabel AS QLABEL
       CAPTION = ""
       Left = 5
       Top = 3
       Width = 192
       Height = 29
       Transparent = 1
      END CREATE
      CREATE gDialogEdit AS QEDIT
       Text = ""
       Left = 4
       Top = 31
       Width = 150
       Height = 29
       TabOrder = 1
      END CREATE
      CREATE gDialogOKButton AS QBUTTON
       CAPTION = "OK"
       Left = 160
       Top = 34
       Width = 34
       TabOrder = 2
       Default = True
       OnClick = gDialogExecute
      END CREATE
      CREATE gDialogCancelButton AS QBUTTON
       CAPTION = "Cancel"
       Left = 200
       Top = 34
       Width = 44
       TabOrder = 3
       Cancel = True
       OnClick = gDialogForm_Close
      END CREATE
     END CREATE


     SUB gDialogForm_Close
      gDialogForm.CLOSE
     END SUB

     SUB gDialogExecute
      gDialogForm.CLOSE
      SELECT CASE gDialogLabel.Tag
      CASE 0
       IF gDialogEdit.Text <> "" THEN
        DEFINT i = VAL(gDialogEdit.Text)
        re.GotoLine(i)
        re.EnsureLineVisible(i)
        re.SetFocus
       END IF
      CASE ELSE
      END SELECT
     END SUB



'==================================================================================
'==================================================================================

     CREATE IDEimageViewerForm AS QFORM
      Width = 100
      Height = 100
      BorderStyle = bsSizeToolWin

      CREATE IDEimage AS QImageEx
       Width = IDEimageViewerForm.ClientWidth
       Height = IDEimageViewerForm.ClientHeight
       Autosize = True
      END CREATE
     END CREATE

     SUB ImageViewerLoad(TheFileName AS STRING)
      SELECT CASE StripFileExt(TheFileName)           'should already be upper case

      CASE ".BMP"
       IDEimage.Stretch = False
       IDEimage.BMP = TheFileName
       IDEimageViewerForm.ClientWidth = IDEimage.Width
       IDEimageViewerForm.ClientHeight = IDEimage.Height

      CASE ".ICO"
       IDEimage.Width = 100
       IDEimage.Height = 100
       IDEimage.Stretch = True
       IDEimage.icon = TheFileName
       IDEimageViewerForm.ClientWidth = IDEimage.Width '* 4
       IDEimageViewerForm.ClientHeight = IDEimage.Height '* 4       'zoom those icons

      CASE ".JPG", ".JPEG", ".GIF", ".TGA",  ".RLE", ".DIB", ".PCX"
       IF NViewLibPresent = True THEN
        IDEimage.Stretch = False
        IDEimage.LoadOtherImage (TheFileName, 0, 0)
       END IF
      END SELECT

      IDEimageViewerForm.Top = Screen.MOUSEY - IDEimageViewerForm.Height           'put at cursor
      IDEimageViewerForm.Left = RightPanel.Left - IDEimageViewerForm.Width
      IDEimageViewerForm.Show
     END SUB


     SUB gDialogCancel
      gDialogForm.CLOSE
     END SUB




'==================================================================================
'==================================================================================
' General list box for global use

     CREATE gListForm AS QFORM
      BorderStyle = bsSizeToolWin
      CAPTION = "List"
      Width = 352
      Height = 640
      Center
      CREATE gListLabel AS QLABEL
       CAPTION = "Double Click to jump to line"
       Font.Size = 10
       Left = 26
       Top = 5
       Width = 200
       Height = 21
      END CREATE

      CREATE gListBox AS QLISTBOX
       Font.Size = 10
       Left = 0
       Top = 22
       Width = 480
       Height = 557
       OnDblClick = gListExecute
      END CREATE

      CREATE gListCancelButton AS QBUTTON
       CAPTION = "Cancel"
       Left = 4
       Height = 23
       Top = gListBox.Top + gListBox.Height + 2
       Width = 70
       TabOrder = 3
       Cancel = True
       OnClick = gListForm_Close
      END CREATE

      CREATE gListOkButton AS QBUTTON
       CAPTION = "Ok"
       Left = 0
       Height = 23
       Top = gListBox.Top + gListBox.Height + 2
       Width = 70
       Left = 150
       TabOrder = 3
       OnClick = gListExecute
      END CREATE

     END CREATE


     SUB gListExecute
      gListForm.CLOSE
      SELECT CASE gListOkButton.Tag                                   'use the tag for which function to perform
      CASE 1                                                      'using list for bookmarks
       DEFINT i = MFE_Tab.TabIndex                             'set to current tab
       DEFINT j = IDE.BookMark(i, gListBox.ItemIndex+1)        'set to current bookmark line
       DEFSTR s = gListBox.Item(gListBox.ItemIndex)
       IF LEFT$(s, 1) = "<" THEN
        i = VAL(MID$(s , 2, INSTR(s, "> ") - 2 ))           'get tab index
        j = VAL(MID$(s , RINSTR(s, ": ") +2, LEN(s)))       'get the line #
       END IF
       IF i <> MFE_Tab.TabIndex THEN MFE_ChangeToIndex(i)
       re.GotoLine(IDE.BookMark(i, j))
       re.EnsureLineVisible(j)
       re.SetFocus
      CASE 2                                          'using list for directory tree
       tmpList.Text = DirTree.Directory            'use global trash list for return, returns trailing "\"
      CASE ELSE
      END SELECT
     END SUB


     SUB gListForm_Close
      gListForm.CLOSE
     END SUB

掌柜推荐
 
 
¥1,390.00 ·
 
 
¥287.00 ·
 
 
¥410.00 ·
 
 
¥1,380.00 ·
 
 
¥1,080.00 ·
 
 
¥271.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2010-12-07 21:18:03