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

📄 xp_statusbar.ctl

📁 主要功能:接收和发送短信
💻 CTL
📖 第 1 页 / 共 5 页
字号:
                                    ' Lines for the last panel.
                                    DrawALine .hdc, rc.lRight - 1, Y, rc.lRight - 1, Y1, lColorTmp1
                                    DrawALine .hdc, rc.lRight - 2, Y, rc.lRight - 2, Y1, lColorTmp2
                                End If
                    
                            
                        Case [Simple]
                                DrawALine .hdc, X, Y, X, Y1, TranslateColorToRGBSimple(oBackColor, 50)
                                
                                
                        Case [XP Diagonal Left]
                                If i > 1 Then
                                    lOffset = (Y1 / 2 = Int(Y1 / 2))    ' even or odd ?
                                    ltmp = Y1 \ 2
                                    DrawALine .hdc, X - ltmp - 1, Y, X + ltmp + lOffset - 1, Y1, vbGray
                                    DrawALine .hdc, X - ltmp, Y, X + ltmp + lOffset, Y1, RGB(90, 90, 90)
                                    DrawALine .hdc, X - ltmp + 1, Y, X + ltmp + lOffset + 1, Y1, vbWhite
                                    UserControl.Refresh
                                End If
            
                        Case [XP Diagonal Right]
                                If i > 1 Then
                                    lOffset = (Y1 / 2 = Int(Y1 / 2))    ' even or odd ?
                                    ltmp = Y1 \ 2
                                    DrawALine .hdc, X + ltmp - 1, Y, X - ltmp - lOffset - 1, Y1, vbGray
                                    DrawALine .hdc, X + ltmp, Y, X - ltmp - lOffset, Y1, RGB(90, 90, 90)
                                    DrawALine .hdc, X + ltmp + 1, Y, X - ltmp - lOffset + 1, Y1, vbWhite
                                    UserControl.Refresh
                                End If
                                
                        End Select
                        
                    End If
                    
                
                    ' Design the panels ground
                    Select Case m_Apperance
        
                        Case [Office XP]
                                DrawASquare .hdc, rcPanel(i), vbButtonShadow, False
                                
                        Case [Windows XP]
                                
                        Case [Simple]
                                X = X + 2
        
                        Case [XP Diagonal Left]
                        
                        Case [XP Diagonal Right]
                                
                    End Select
                    
                End With
                
                ' === Maybe we want to draw some fancy background gradients and framing stuff ;) ... ===
                InflateRect rc, -3, -2
                            
                ' Gradients ?
                lGapToBorder = UserControl.ScaleHeight / 7
                Select Case .PanelGradient
    
                        Case 1      ' [Transparent]     :  So do nothing ;)
                
                
                        Case 2      ' [Opaque]          :  Draw a simple rectangle in panels background color
                                    CopyRect rcTemp, rc
                                    With rcTemp
                                        .lLeft = .lLeft + 1
                                        .lRight = .lRight - 2
                                    End With
                                    DrawASquare UserControl.hdc, rcTemp, .PanelBckgColor, True
                                    
                
                        Case 3      ' [Top Bottom]      :  Simple gradient 1
                                    DrawVertGradient .PanelBckgColor, vbWhite, _
                                            X + 3, .ClientWidth - 7, _
                                            lGapToBorder, UserControl.ScaleHeight - lGapToBorder
                                            
                                            
                        Case 4      ' [Top 1/3 Bottom]  :  Complex gradient 1
                                    DrawVertGradient .PanelBckgColor, vbWhite, _
                                            X + 3, .ClientWidth - 7, _
                                            lGapToBorder, UserControl.ScaleHeight / 3 + 2
                                            
                                    DrawVertGradient vbWhite, .PanelBckgColor, _
                                            X + 3, .ClientWidth - 7, _
                                            UserControl.ScaleHeight / 3 + 2, UserControl.ScaleHeight - lGapToBorder
                                            
                                            
                        Case 5      ' [Top 1/2 Bottom]  :  Complex gradient 2
                                    DrawVertGradient .PanelBckgColor, vbWhite, _
                                            X + 3, .ClientWidth - 7, _
                                            lGapToBorder, UserControl.ScaleHeight / 2
                                            
                                    DrawVertGradient vbWhite, .PanelBckgColor, _
                                            X + 3, .ClientWidth - 7, _
                                            UserControl.ScaleHeight / 2, UserControl.ScaleHeight - lGapToBorder
                                                
                                                
                        Case 6      ' [Top 2/3 Bottom]  :  Complex gradient 3
                                    DrawVertGradient .PanelBckgColor, vbWhite, _
                                            X + 3, .ClientWidth - 7, _
                                            lGapToBorder, (UserControl.ScaleHeight / 3) * 2 - 3
                                            
                                    DrawVertGradient vbWhite, .PanelBckgColor, _
                                            X + 3, .ClientWidth - 7, _
                                            (UserControl.ScaleHeight / 3) * 2 - 2, UserControl.ScaleHeight - lGapToBorder
                                            
                                            
                        Case 7      ' [Bottom Top]      :  Simple gradient 2
                                    DrawVertGradient vbWhite, .PanelBckgColor, _
                                            X + 3, .ClientWidth - 7, _
                                            lGapToBorder, UserControl.ScaleHeight - lGapToBorder
                                    
                End Select
    
            
                ' Draw the OUTER Edge
                rc.lTop = lGapToBorder
                rc.lBottom = UserControl.ScaleHeight - (lGapToBorder - 2)
                DrawEdge UserControl.hdc, rc, .PanelEdgeOuter, BF_TOPLEFT
                DrawEdge UserControl.hdc, rc, .PanelEdgeOuter, BF_BOTTOMRIGHT
                
                ' make rectangle smaller by inner spacing property
                InflateRect rc, -.PanelEdgeSpacing, -.PanelEdgeSpacing
                
                ' Draw the INNER Edge
                DrawEdge UserControl.hdc, rc, .PanelEdgeInner, BF_TOPLEFT
                DrawEdge UserControl.hdc, rc, .PanelEdgeInner, BF_BOTTOMRIGHT
                            

                ' Get the size of the picture
                If Not .PanelPicture Is Nothing Then
                    pX = UserControl.ScaleX(.PanelPicture.Width, vbHimetric, UserControl.ScaleMode)
                    pY = UserControl.ScaleY(.PanelPicture.Height, vbHimetric, UserControl.ScaleMode)
                End If
               
                ' Create a temporary RECT to draw some text into.
                GetClientRect UserControl.hwnd, rcTemp
                
                ' = HERE we finally draw the text ! =
               
               
                ' Get size rect
                DrawText UserControl.hdc, "DummyText", Len("DummyText"), rcTemp, DT_CALCRECT Or DT_WORDBREAK
                
                CopyRect rc, rcTemp
                
                ' Set our RECTs position
                With rc
                    Select Case m_Panels(i).PanelPicAlignment
                    
                        Case [PP Left]
                                .lLeft = X + pX + 2
                                .lRight = ((.lLeft + X1) - 10) - pX
                                    
                        Case [PP Center]
                                .lLeft = X
                                .lRight = ((.lLeft + X1) - 10)
                                
                        Case [PP Right]
                                .lLeft = X
                                .lRight = ((.lLeft + X1) - 10) - pX
                                
                    End Select
                End With
                
                If .PanelEdgeOuter <> 0 Then
                    InflateRect rc, -3, 0
                End If
                If .PanelEdgeInner <> 0 Then
                    InflateRect rc, -(.PanelEdgeSpacing + 3), 0
                End If
                
                ' Save this contents area !
                .ContentsLeft = rc.lLeft
                .ContentsTop = rc.lTop
                .ContentsRight = rc.lRight
                .ContentsBottom = rc.lBottom
                
                
                ' Draw the text into our new panel.
                SetTextColor UserControl.hdc, IIf(.pEnabled = True, oForeColor, oDissColor)
                OffsetRect rc, 4, (ScaleHeight - rc.lBottom) / 2
                If .TextBold = True Then
                    UserControl.FontBold = True
                Else
                    UserControl.FontBold = False
                End If
                DrawText UserControl.hdc, .PanelText, Len(.PanelText), rc, .TextAlignment
                
            
                ' Add a PanelPicture if required.
                
                ' TODO :
                '           Picture will spill into the next panel if for some reason someone
                '           sets the PanelWidth to a smaller width than the image.
                '
                '           Seems not really be a great prob... ;) - LT
                '           Thats visible to the designer and (now ;) ) preventable with  'MinWidth' .
                '
                
                If Not (.PanelPicture Is Nothing) Then
                
                    ' Left/Center/Right?
                    lPPxPos = Choose(.PanelPicAlignment + 1, _
                            IIf(.PanelEdgeInner = 0, X + 5, X + 7 + .PanelEdgeSpacing), _
                            X + (.ClientWidth / 2) - (pX / 2), _
                            (X + .ClientWidth) - (pX + 5 + IIf(.PanelEdgeInner = 0, 0, .PanelEdgeSpacing)))
                            
                    PaintTransparentPicture UserControl.hdc, _
                            .PanelPicture, _
                            lPPxPos, (ScaleHeight - pY) / 2, _
                            pX, pY, _
                            0, 0, _
                            oMaskColor
                           
                    Refresh     ' Ensure we see all drawings
                            
                End If
                            
                'Dont forget to move the X for the next panel ...
                X = X + .ClientWidth
                
            End If  ' .pVisible = True
        End With
    Next i  ' ... uff !!!


    ' If there are integrated controls: Set position(s)             ' Magic number format "### 03 0050 +"
    On Error Resume Next                                            ' Means: Put control to panel 3, 50 twips from left panel
    For Each ContainedCtrl In UserControl.ContainedControls         ' border and adjust size in horicontaldirection. Use "-"
        With ContainedCtrl                                          ' for no adjustment e.g. "### 02 0050 -"
            If Len(.Tag) = 13 And Left$(.Tag, 4) = "### " Then      ' Handle controls with "magic number tag" only!
                i = Val(Mid$(.Tag, 5, 2))                           ' Get panel index
                
                If i > 0 And i <= m_PanelCount Then                 ' Only if we HAVE panels!
                    If m_Panels(i).pVisible = True Then
                        .Visible = True
                        X = Val(Mid$(.Tag, 8, 4))
                        .Left = UserControl.ScaleX(m_Panels(i).ContentsLeft + 3, vbPixels, vbTwips) + X
                        If Right$(.Tag, 1) = "+" Then
                            ltmp = (UserControl.ScaleX(m_Panels(i).ContentsRight, vbPixels, vbTwips)) - .Left
                            If ltmp > 0 Then
                                .Width = ltmp
                            End If
                        End If
                    Else
                        .Visible = False                            ' Don't show integrated controls on invisible panels!
                    End If
                End If
            End If
            
        End With
    Next ContainedCtrl
    
    On Error GoTo 0

    If bDrawGripper = True Then
        DrawGripper
    End If
    
    RaiseEvent AfterRedraw
    
    flgNoTimerInterrupt = False
    
    On Error GoTo 0

    Exit Sub


error_handler:

    MsgBox "Error [" + Err.Description + "] in procedure 'DrawStatusBar()' at Benutzersteuerelement XP_StatusBar"
    flgNoTimerInterrupt = False
    
End Sub


Private Sub DrawGripper()
    
    Dim lColorHighLite  As Long
    Dim lColorShaddow   As Long
    Dim lColorGrad      As Long
    Dim i               As Long
    
    With rcGripper
        .lLeft = UserControl.ScaleWidth - 15
        .lRight = UserControl.ScaleWidth
        .lBottom = UserControl.ScaleHeight
        .lTop = UserControl.ScaleHeight - 15
    End With
    
    With UserControl
                
        ' HiLite and Shaddow color
        If m_UseWindowsColors = True Then
            lColorHighLite = ColorToRGB(GetSysColor(COLOR_BTNHIGHLIGHT))
            lColorShaddow = ColorToRGB(GetSysColor(COLOR_BTNSHADOW))
        Else
            lColorHighLite = TranslateColorToRGBSimple(.BackColor, -50)
            lColorShaddow = TranslateColorToRGBSimple(.BackColor, 50)
        End If
        
        Select Case m_Apperance
            
            Case [Windows XP]
                    ' Retain the area
                    If m_BackgroundPic Is Nothing Then
                        DrawASquare .hdc, rcGripper, .BackColor, True
                    
                    
                        DrawALine .hdc, rcGripper.lLeft, rcGripper.lBottom - 1, rcGripper.lRight, rcGripper.lBottom - 1, _
                                TranslateColorToRGBSimple(oBackColor, -15), 2

                        DrawALine .hdc, rcGripper.lLeft, rcGripper.lBottom - 3, rcGripper.lRight, rcGripper.lBottom - 3, _
                                TranslateColorToRGBSimple(oBackColor, -8), 2
                    End If
                    
                    DrawALine .hdc, .ScaleWidth - 3, .ScaleHeight - 3, .ScaleWidth - 3, .ScaleHeight - 3, lColorShaddow, 2
                    DrawALine .hdc, .ScaleWidth - 7, .ScaleHeight - 3, .ScaleWidth - 7, .ScaleHeight - 3, lColorShaddow, 2
                    DrawALine .hdc, .ScaleWidth - 11, .ScaleHeight - 3, .ScaleWidth - 11, .ScaleHeight - 3, lColorShaddow, 2
                
                    DrawALine .hdc, .ScaleWidth - 3, .ScaleHeight - 7, .ScaleWidth - 3, .ScaleHeight - 7, lColorShaddow, 2
                    DrawALine .hdc, .ScaleWidth - 7, .ScaleHeight - 7, .ScaleWidth - 7, .ScaleHeight - 7, lColorShaddow, 2
                
                    DrawALine .hdc, .ScaleWidth - 3, .ScaleHeight - 11, .ScaleWidth - 3, .ScaleHeight - 11, lColorShaddow, 2
                
                    DrawALine .hdc, .ScaleWidth - 4, .ScaleHeight - 4, .ScaleWidth - 4, .ScaleHeight - 4, lColorHighLite, 2
                    DrawALine .hdc, .ScaleWidth - 8, .ScaleHeight - 4, .ScaleWidth - 8, .ScaleHeight - 4, lColorHighLite, 2
                    DrawALine .hdc, .ScaleWidth - 12, .ScaleHeight - 4, .ScaleWidth - 12, .ScaleHeight - 4, lColorHighLite, 2
                
                    DrawALine .hdc, .ScaleWidth - 4, .ScaleHeight - 8, .ScaleWidth - 4, .ScaleHeight - 8, lColorHighLite, 2
                    DrawALine .hdc, .ScaleWidth - 8, .ScaleHeight - 8, .ScaleWidth - 8, .ScaleHeight - 8, lColorHighLite, 2
                
                    DrawALine .hdc, .ScaleWidth - 4, .ScaleHeight - 12, .ScaleWidth - 4, .ScaleHeight - 12, lColorHighLite, 2
        
        
            Case [Office XP]
                    ' Retain the area
                    If m_BackgroundPic Is Nothing Then
                        DrawASquare .hdc, rcGripper, .BackColor, True
                    End If
                    
                    For i = 5 To 15 Step 5

⌨️ 快捷键说明

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