Guidance
指路人
g.yi.org
software / rapidq / Examples / Tools - IDE, Designer, Builder / FreeQ IDE src / MenuDesigner / frmPreview.bas

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

  
     $INCLUDE "QREdit.inc"
     $RESOURCE Copy_bmp AS "Bitmaps\Copy.bmp"
'$RESOURCE Exit_bmp as "Bitmaps\Exit.bmp"
'$RESOURCE Save_bmp as "Bitmaps\Save.bmp"


     CREATE FrmPreview AS QFORM
      ICOHandle = MenuDesigner_ico
      CAPTION = "MenuDesigner  Preview  $NoName.inc"
      Width = 575
      Height = 460
      Autoscroll = 0
    'DelBorderIcons = biMinimize or biMaximize
      OnResize = frmResize
      windowState = wsMaximized
      Center
      CREATE cmdSaveCode AS QXPButton
       BMPHandle = Save_bmp
       CAPTION = "&Save Code"
       Left = 460
       Top = 15
       Width = 100
       onclick = cmdSaveCode_click
      END CREATE
      CREATE cmdCopyCode AS QXPButton
       BMPHandle = Copy_bmp
       CAPTION = "&Copy Code"
       Left = 460
       Top = 50
       Width = 100
       onclick = cmdCopyCode_Click
      END CREATE
      CREATE cmdClosePreview AS QXPButton
       BMPHandle = Exit_bmp
       CAPTION = "C&lose Preview"
       Left = 460
       Top = 85
       Width = 100
       onclick = cmdClosePreview_Click
      END CREATE
      CREATE rhtCode AS QREdit
       Left = 15
       Top = 15
       Width = 425
       Height = 390
       WordWrap = False
       Clear
       ScrollBars = 3
       AddSyntaxes("DECLARE", "SUB", "CREATE ", "END ", " as ", "QMAINMENU", "QMENUITEM")
       HiLight
       ReadOnly = 0
      END CREATE
     END CREATE



     SUB cmdSaveCode_Click (Sender AS QBUTTON)
      DIM ext$ AS STRING
      DIM p AS INTEGER
      SaveDialog.CAPTION = "Save Menu Include as..."
      SaveDialog.Filter = "Menu Include (*.inc)|*.inc|All Files (*.*)|*.*"

      IF ArchivoMenu <> "$NoName.inc" THEN
       SaveDialog.FileName = ArchivoMenu
      ELSE
       SaveDialog.FileName = "$NoName.inc"
      END IF

      IF SaveDialog.EXECUTE THEN
       ArchivoMenu = SaveDialog.FileName
       ext$ = RIGHT$(ArchivoMenu,4)
       IF ext$ <> ".inc" THEN ArchivoMenu = ArchivoMenu + ".inc"
       rhtCode.PlainText = 1
       rhtCode.SaveToFile ArchivoMenu
       p = rinstr(ArchivoMenu,"\\")
       ArchivoMenu = MID$(ArchivoMenu,p + 1)
       frmPreview.CAPTION = "MenuDesigner Preview  " + ArchivoMenu
       SHOWMESSAGE ArchivoMenu + " Saved"
      END IF
      rhtCode.PlainText = 0
     END SUB

     SUB cmdCopyCode_Click (Sender AS QBUTTON)
      ClipBoard.Clear
      rhtCode.SelectAll
      rhtCode.CopyToClipBoard
      rhtCode.SelStart = 1
     END SUB

     SUB cmdClosePreview_Click (Sender AS QBUTTON)
      frmPreview.CLOSE
     END SUB

     SUB frmResize
      rhtCode.width = frmPreview.clientwidth - 150
      rhtCode.height = frmPreview.clientheight - rhtCode.top - 10
      cmdSaveCode.Left = frmPreview.clientwidth - 115
      cmdCopyCode.Left = frmPreview.clientwidth - 115
      cmdClosePreview.Left = frmPreview.clientwidth - 115
     END SUB
掌柜推荐
 
 
¥1,800.00 ·
 
 
¥489.00 ·
 
 
¥288.00 ·
 
 
¥908.00 ·
 
 
¥748.00 ·
 
 
¥264.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2010-12-07 21:18:04