Guidance
指路人
g.yi.org
software / rapidq / Examples / QObject / QCoolBarXP / QCoolBar_Example.bas

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

  
'$Include "RapidQ.INC"
     $INCLUDE "QCoolBarXP87.inc"

     $RESOURCE Snew_bmp	AS "New2.bmp" '"..\_RES\BMP\New2.bmp" '
     $RESOURCE Sopen_bmp	AS "Open.bmp" '"..\_RES\BMP\Open.bmp" '
     $RESOURCE Ssave_bmp	AS "Save.bmp" '"..\_RES\BMP\Save.bmp" '
'$REsource Shelp_bmp	AS "..\_Projets\WindowsIconizé!\_RES\BMP\Help.bmp"

'$REsource WUndo_bmp	AS "..\_Projets\WindowsIconizé!\_RES\BMP\WUndo.bmp"
'$REsource WRedo_bmp	AS "..\_Projets\WindowsIconizé!\_RES\BMP\WRedo.bmp"
'$REsource OCopy_bmp	AS "..\_Projets\WindowsIconizé!\_RES\BMP\Duplicate.bmp"

'$REsource CBoxPrev_bmp	AS "..\_Projets\WindowsIconizé!\_RES\BMP\Prev2.bmp"
'$REsource CBoxNext_bmp	AS "..\_Projets\WindowsIconizé!\_RES\BMP\Next2.bmp"
'$REsource OConfig_bmp	AS "..\_Projets\WindowsIconizé!\_RES\BMP\Config.bmp"
'$REsource OWizard_bmp	AS "..\_Projets\WindowsIconizé!\_RES\BMP\WizardBI.bmp"

     $RESOURCE TBarBtn1_BMP	AS "TBarBtn1I.bmp" '"..\_Projets\WindowsIconizé!\_RES\BMP\TBarBtn1I.bmp" '
'$REsource TBarBtn2_BMP	AS "..\_Projets\WindowsIconizé!\_RES\BMP\TBarBtn2I.bmp"
'$REsource TBarBtn3_BMP	AS "..\_Projets\WindowsIconizé!\_RES\BMP\TBarBtn3I.bmp"

'$REsource TTips_bmp	AS "..\_Projets\WindowsIconizé!\_RES\BMP\ShowHide_TipsI.bmp"
'$REsource TToolBar_bmp	AS "..\_Projets\WindowsIconizé!\_RES\BMP\ShowHide_ToolBarI.bmp"
'$REsource TTrayIcon_bmp	AS "..\_Projets\WindowsIconizé!\_RES\BMP\ShowHide_TrayIconI.bmp"


     DECLARE SUB Form_Click (Sender AS QFORM)
     DECLARE SUB Form_Resize (Sender AS QFORM)
     DECLARE SUB CoolBar_MoveIn (X AS INTEGER, Y AS INTEGER, Shift AS INTEGER, ItemIndex AS INTEGER, Sender AS QCoolBarXP)
     DECLARE SUB CoolBar_MoveOut (X AS INTEGER, Y AS INTEGER, Shift AS INTEGER, Sender AS QCoolBarXP)
     DECLARE SUB CoolBar_Change (ItemIndex AS INTEGER, Sender AS QCoolBarXP)

'Style = 3
     DIM isXP AS INTEGER			' Mémorise la détection de XP pour forcer ça désactivation (XP Seulement)
     isXP = isXP_QTBtn

     DIM openItem AS QMENUITEM
     openItem.CAPTION = "... <vide>"
     DIM dummyItem AS QMENUITEM
     dummyItem.CAPTION = "... <vide>"

     DIM Edit AS QEDIT
     DIM ComboBox AS QCOMBOBOX

     CREATE Form AS QFORM
      CAPTION = "CoolBarXP"
      Width = 360
      Height = 240
      Center
      COLOR = IIF(isXP_QTBtn, -2147483638, -2147483636)
      CREATE CoolBar3 AS QCoolBarXP
        'Skin.BMPHandle = btn_BMP
       Align = True 'alTop 'alLeft 'alTop
        'Left = 6
        'Top = 8
       Width = 354
       Height = 40
       ItemsWidth = 40
       AddItems ("...", "-", "...", "-", "...", "-") ', "EditCtrl0")
        '- Enabled State/État normal et activé
       imglA.Height	= 32
       imglA.Width	= 32
       imglA.addbmphandle TBarBtn1_BMP, 0 'clPurple 'transparentColor
        'imglA.addbmphandle TBarBtn2_BMP, 0 'clPurple 'transparentColor
        'imglA.addbmphandle TBarBtn3_BMP, 0 'clPurple 'transparentColor
       imglA.addbmphandle TBarBtn1_BMP, 0 'clPurple 'transparentColor
       imglA.addbmphandle TBarBtn1_BMP, 0 'clPurple 'transparentColor
       CAPTION = "CoolBar3"
       HideCaption = False
       ShowGrip = True
        'mnuPopup(0).AddItems(openItem)
        'mnuPopup(5).AddItems(dummyItem)
       AddEditCtrl (Edit)
       RePaint
       OnMouseEnter = CoolBar_MoveIn
       OnMouseLeave = CoolBar_MoveOut
       OnChange = CoolBar_Change
      END CREATE
      CREATE CoolBar2 AS QCoolBarXP
       Align = True 'alTop 'alLeft 'alTop
        'Left = 6
        'Top = 8
       Width = 354
        'Height = 34
       AddItems ("...", "...", "...", "-", "...", "...", "-")
        '- Enabled State/État normal et activé
       imglA.Height	= 16
       imglA.Width	= 16
        'imglA.addbmphandle TToolBar_bmp, 0 'clPurple
        'imglA.addbmphandle TTips_bmp, 0 'clPurple
        'imglA.addbmphandle TTrayIcon_bmp, 0 'clPurple
        'imglA.addbmphandle CBoxPrev_bmp, 0 'clPurple 'transparentColor
        'imglA.addbmphandle CBoxNext_bmp, 0 'clPurple 'transparentColor
       imglA.addbmphandle Snew_bmp,	0 'clPurple 'transparentColor
       imglA.addbmphandle Sopen_bmp,	0 'transparentColor
       imglA.addbmphandle Ssave_bmp,	clPurple 'transparentColor
       imglA.addbmphandle Snew_bmp,	0 'clPurple 'transparentColor
       imglA.addbmphandle Sopen_bmp,	0 'transparentColor
       CAPTION = "CoolBar2"
       HideCaption = False
       ShowGrip = True
        'mnuPopup(0).AddItems(openItem)
        'mnuPopup(5).AddItems(dummyItem)
       AddComboBoxCtrl (ComboBox)
       RePaint
       OnMouseEnter = CoolBar_MoveIn
       OnMouseLeave = CoolBar_MoveOut
       OnChange = CoolBar_Change
      END CREATE
      CREATE CoolBar1 AS QCoolBarXP
       Align = True 'alTop 'alLeft 'alTop
        'Left = 6
        'Top = 8
       Width = 354
        'Height = 34
       ShowBtnsCaption (True, 0, 1)
       AddItems ("Nouveau", "Ouvrir", "Enregistrer", "-", "...", "...", "...", "-", "...", "...", "...")
        '- Enabled State/État normal et activé
       imglA.Height = 16
       imglA.Width = 16
       imglA.addbmphandle Snew_bmp,	0 'clPurple 'transparentColor
       imglA.addbmphandle Sopen_bmp,	0 'transparentColor
       imglA.addbmphandle Ssave_bmp,	clPurple 'transparentColor
        'imglA.addbmphandle WUndo_bmp, 0 'clPurple 'transparentColor
        'imglA.addbmphandle WRedo_bmp, 0 'clPurple 'transparentColor
        'imglA.addbmphandle OCopy_bmp,	0 'clPurple 'transparentColor
        'imglA.addbmphandle OConfig_bmp, 0 'clPurple 'transparentColor
        'imglA.addbmphandle SHelp_bmp,	clPurple 'transparentColor
        'imglA.addbmphandle OWizard_bmp, 0 'clPurple 'transparentColor
       imglA.addbmphandle Snew_bmp,	0 'clPurple 'transparentColor
       imglA.addbmphandle Sopen_bmp,	0 'transparentColor
       imglA.addbmphandle Ssave_bmp,	clPurple 'transparentColor
       imglA.addbmphandle Snew_bmp,	0 'clPurple 'transparentColor
       imglA.addbmphandle Sopen_bmp,	0 'transparentColor
       imglA.addbmphandle Ssave_bmp,	clPurple 'transparentColor
       CAPTION = "CoolBar1"
       HideCaption = False
       ShowGrip = True
       mnuPopup(0).AddItems(openItem)
       mnuPopup(2).AddItems(dummyItem)
        'RePaint
       OnMouseEnter = CoolBar_MoveIn
       OnMouseLeave = CoolBar_MoveOut
       OnChange = CoolBar_Change
      END CREATE
      CREATE CoolBar4 AS QCoolBarXP
        'Skin.BMPHandle = btn_BMP
       Align = 3 'alTop 'alLeft 'alTop
       Left = 6
       Top = 8
       Width = 26 '354
        'Height = 40
       BevelWidth = False
       ItemsWidth = 24
       Orientation = True 'Doit être déclarer avant AddItems
       AddItems ("...", "-", "...", "-", "...", "-") ', "EditCtrl0")
        '- Enabled State/État normal et activé
       imglA.Height	= 16
       imglA.Width	= 16
       imglA.addbmphandle Sopen_bmp,	0 'transparentColor
       imglA.addbmphandle Ssave_bmp,	clPurple 'transparentColor
       imglA.addbmphandle Snew_bmp,	0 'clPurple 'transparentColor
       CAPTION = ""
        'HideCaption = False
       ShowGrip = True
        'mnuPopup(0).AddItems(openItem)
        'mnuPopup(5).AddItems(dummyItem)
        'AddEditCtrl (Edit)
        'Width = 24 '354
       RePaint
       OnMouseEnter = CoolBar_MoveIn
       OnMouseLeave = CoolBar_MoveOut
       OnChange = CoolBar_Change
      END CREATE
      CREATE StatusBar1 AS QSTATUSBAR
       AddPanels ("")
      END CREATE
      OnClick = Form_Click
      OnResize = Form_Resize
     END CREATE


     SUB Combo_Change(Sender AS QCOMBOBOX)
      IF isXP THEN
       isXP_QTBtn = Sender.ItemIndex
       CoolBar1.RePaint
       CoolBar2.RePaint
       CoolBar3.RePaint
       CoolBar4.RePaint
      END IF
     END SUB

     ComboBox.AddItems ("Plat", "Style XP (XP Seulement)")
     ComboBox.Style = 2
     ComboBox.OnChange = Combo_Change
     ComboBox.ItemIndex = IIF(isXP, True, False)

     Form.SHOWMODAL

'Sub Form_Click
'    If isXP Then
'        If isXP_QTBtn = True Then _
'            isXP_QTBtn = False _
'        Else _
'            isXP_QTBtn = True
'    End If
'    'If Style < 3 Then Style++ Else Style = False
'    CoolBar1.RePaint
'    CoolBar2.RePaint
'    CoolBar3.RePaint
'    CoolBar4.RePaint
'    'StatusBar1.Panel(0).Caption = "Style " +STR$(Style)
'End Sub

'Sub Form_Resize
'End Sub

     SUB CoolBar_MoveIn
      StatusBar1.Panel(0).CAPTION = "À l'intérieur, " +"  Button " +STR$(ItemIndex) +" " +STR$(X)
     END SUB
     SUB CoolBar_MoveOut
      StatusBar1.Panel(0).CAPTION = "Dehors..."
     END SUB

     SUB CoolBar_Change
      StatusBar1.Panel(0).CAPTION = "Bouton " +STR$(ItemIndex) +" cliqué..."
      IF Sender.CAPTION = "CoolBar2" THEN _
       IF ItemIndex = 4 OR ItemIndex = 5 THEN _
       ComboBox.ItemIndex = IIF(ComboBox.ItemIndex, False, True)
      Combo_Change(ComboBox)
     END SUB
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Wed 2023-2-1  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2013-06-19 07:50:28