Guidance
指路人
g.yi.org
software / rapidq / Examples / Date & Time / A complete PRG / frmMain.bas

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

  
'*****************************************************************************'
'CODER : Victor Garnier (FRANCE).                                             '
'CODER EMAIL : victor.garnier@ifrance.com                                     '
'REALEASE DATE : 15/10/2002                                                   '

'-----------------------------------------------------------------------------'

     SUB DummyProc:END SUB                           '>>I catch that one
                                                'from rapidq yahoo group
                                                'to prevent that the minimize
                                                'event put the form on the
                                                'desktop rather than on the
                                                'taskbar....

'>>Always better to use Create rather then the keyword Parent.
'See how indentation gets important here.

     CREATE frmMain AS QFORM
      Width = 640
      Height = 480
      Center
      BorderStyle = -1                            'Don't ask me why but -1
                                                'it's not part of rapidQ.inc
                                                'Constantes for QFORM Variables

      DelBorderIcons(2)                           'maximize is not enabled....

      WndProc = DummyProc                         'See what dummyProc Do -:)

    '------------------------------------TOOLBAR
      CREATE ToolBar AS QPANEL                    'My toolbar is in frmMain
       Left = 1
       Top = 0
       Width = frmMain.ClientWidth - 2
       Height = 36
       BevelOuter = 1
       Align = 1
       CREATE btnAnnuler AS QCOOLBTN
        BmpHandle = bmpAnnuler
        Cursor = crHandPoint                'Hand
        Left = 2
        Top = 2
        Height = 32
        Width = 32
        Layout = -1
        Flat = 1
        Hint = "Annuler"
        ShowHint = 1
        OnClick = pBtnAnnuler               'This mean that when the
                                                'user click on btnAnnuler
                                                'the Procedure call
                                                'pBtnAnnuler, fire.
                                                'See procDec.bas....
       END CREATE

       CREATE btnNouveau AS QCOOLBTN
        BmpHandle = bmpNouveau
        Cursor = crHandPoint
        Left = 104
        Top = 2
        Height = 32
        Width = 32
        Flat = 1                            '>>Remember 1 = true
                                                '0 = false
        Layout = -1
        Hint = "Nouveau"                    'Hint is like ToolTipText...
        ShowHint = 1
        OnClick = pBtnNouveau
       END CREATE

       CREATE btnEnregistrer AS QCOOLBTN
        BmpHandle = bmpSauve
        Cursor = crHandPoint
        Left = 138
        Top = 2
        Height = 32
        Width = 32
        Flat = True                         '>>Remember -:) 1 = True..
        Layout = -1
        Enabled = False
        Hint = "Enregistrer"
        ShowHint = 1
        OnClick = pBtnEnregistrer
       END CREATE

       CREATE btnImprimer AS QCOOLBTN
        BmpHandle = bmpPrint
        Cursor = crHandPoint
        Left = 172
        Top = 2
        Height = 32
        Width = 32
        Flat = 1
        Layout = -1
        Enabled = True
        Hint = "Imprimer"
        ShowHint = 1
        OnClick = pBtnImprimer
       END CREATE

       CREATE btnQuitter AS QCOOLBTN
        BmpHandle = bmpQuitter
        Cursor = crHandPoint
        Left = frmMain.ClientWidth -34
        Top = 2
        Height = 32
        Width = 32
        Flat = 1
        Layout = -1
        Hint = "Quitter"
        ShowHint = 1
        OnClick = pBtnQuitter
       END CREATE

      END CREATE
    '------------------------------------FIN TOOLBAR

    '------------------------------------MENU
      CREATE mnuMain AS QMAINMENU
       CREATE mnuFichier AS QMENUITEM
        CAPTION = "Fichier"
        Enabled = True
        Visible = True
        CREATE mnuFicNouveau AS QMENUITEM
         CAPTION = "Nouveau"
         Enabled = True
         Visible = True
         OnClick = mnuClicked
        END CREATE
        CREATE mnuFicOuvrir AS QMENUITEM
         CAPTION = "Ouvrir..."
         Enabled = True
         Visible = True
         OnClick = mnuClicked
        END CREATE
        CREATE mnuFicSep1 AS QMENUITEM
         CAPTION = "-"                   'This is a separator item...
         Enabled = True
         Visible = True
         OnClick = mnuClicked
        END CREATE
        CREATE mnuFicQuitter AS QMENUITEM
         CAPTION = "Quitter"
         Enabled = True
         Visible = True
         OnClick = mnuClicked
        END CREATE
       END CREATE
      END CREATE
    '------------------------------------FIN MENU

    '------------------------------------LISTVIEW
      CREATE LstView AS QLISTVIEW
       Width = frmMain.ClientWidth
       Height = frmMain.ClientHeight - (frmMain.ClientHeight - 230) - 1
       Top = frmMain.ClientHeight - 230
       ViewStyle = 3
       RowSelect = True
       GridLines = True
       AddColumns "Description","Montant","Balance","Date"
       Column(0).Width = frmMain.ClientWidth * 0.6
       Column(1).Width = 75
       Column(2).width = 75
       Column(3).width = 90
       OnClick = lstSelectionChange
      END CREATE
    '------------------------------------FIN LISTVIEW

    '------------------------------------DEBUT LISTBOX
      CREATE lbllstBox AS QLABEL
       Top = 38
       Left = 475
       Font.Name = "Verdana"
       Font.Bold = True
       CAPTION = "Liste périodiques"
      END CREATE
      CREATE lstBox AS QLISTBOX
       Top = 57
       Left = 420
       Width = 214
       Height = 135
      END CREATE
    '------------------------------------FIN LISTBOX

    '------------------------------------EDITION
      CREATE lblMontant AS QLABEL
       Top = 60
       Left = 5
       Width = 100
       Height = 16
       Font.Name = "Verdana"
       Font.Bold = True
       CAPTION = "Montant "
      END CREATE
      CREATE txtMontant AS QEDIT
       Top = 57
       Left = 82
       Width = 120
       Enabled = False
       OnKeyPress = ChkMontant
      END CREATE
      CREATE lblDate AS QLABEL
       Top = 96
       Left = 5
       Width = 50
       Height = 16
       Font.Name = "Verdana"
       Font.Bold = True
       CAPTION = "Date "
      END CREATE
      CREATE btnShowDate AS QIMAGE
       Top = 96
       Left = 60
       Cursor = crHandPoint
       AutoSize = True
       BmpHandle = bmpShDate
       OnClick = ShowCalendar
      END CREATE
      CREATE txtDate AS QEDIT                     '>>notice that there is a mask
       Top = 93                                'option here (InputMask)...
       Left = 82
       Width = 120
       InputMask = "##/##/####"
       Enabled = False
      END CREATE
      CREATE lblNature AS QLABEL
       Top = 60
       Left = 210
       Width = 100
       Height = 16
       Font.Bold = True
       CAPTION = "Nature "
      END CREATE
      CREATE cmbNature AS QCOMBOBOX
       Top = 57
       Left = 283
       Width = 120
      END CREATE
      CREATE lblPeriodicité AS QLABEL
       Top = 96
       Left = 210
       Width = 100
       Height = 16
       Font.Name = "Verdana"
       Font.Bold = True
       CAPTION = "Périodicité "
      END CREATE
      CREATE cmbPeriodicite AS QCOMBOBOX
       Top = 93
       Left = 283
       Width = 120
      END CREATE
      CREATE lblDescription AS QLABEL
       Top = 132
       Left = 5
       Width = 100
       Height = 16
       Font.Name = "Verdana"
       Font.Bold = True
       CAPTION = "Description "
      END CREATE
      CREATE txtDescription AS QRICHEDIT
       Top = 129
       Left = 82
       Width = 320
       Height = 35
       Enabled = False
      END CREATE
    '------------------------------------FIN EDITION

    '------------------------------------LABEL SOLDE
      CREATE lblSolde AS QLABEL
       Top = 175
       Left = 82
       Width = frmMain.ClientWidth-152
       Font.Bold = True
       Font.Size = 10
       Font.COLOR = &HFF0000                   'Hexa or long values
       LabelStyle = 1
      END CREATE
     END CREATE





掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sun 2023-1-29  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2002-10-15 13:03:44