home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 2.00 Begin Form w_push_demo BackColor = &H00FFFFFF& BorderStyle = 1 'Fixed Single Caption = "ctPUSH (Picture Push Button) Demo" ClientHeight = 4575 ClientLeft = 915 ClientTop = 1920 ClientWidth = 7755 Height = 5100 Icon = CT_PUSH.FRX:0000 Left = 855 LinkTopic = "Form1" MaxButton = 0 'False MDIChild = -1 'True ScaleHeight = 4575 ScaleWidth = 7755 Top = 1455 Width = 7875 Begin ctSPIN ct_bevel ArrowColor = &H00000000& ArrowSize = 0 'Small BackColor = &H00C0C0C0& BevelSize = 2 BorderColor = &H00000000& DisableColor = &H00808080& Enabled = 0 'False Height = 375 InitialDelay = 200 Left = 4590 RepeatRate = 100 SpinStyle = 0 'Vertical TabIndex = 16 Top = 2640 Width = 225 End Begin CheckBox Check2 BackColor = &H00FFFFFF& Caption = "Expand Picture" ForeColor = &H00000000& Height = 285 Left = 600 TabIndex = 15 Top = 2670 Width = 1755 End Begin CheckBox Check1 BackColor = &H00FFFFFF& Caption = "Picture Only" ForeColor = &H00000000& Height = 225 Left = 600 TabIndex = 14 Top = 2400 Width = 1575 End Begin CheckBox chk_disable BackColor = &H00FFFFFF& Caption = "Disable Button" ForeColor = &H00000000& Height = 255 Left = 600 TabIndex = 12 Top = 2100 Width = 1635 End Begin Frame Frame1 BackColor = &H00FFFFFF& Caption = "Picture Position" ForeColor = &H00000000& Height = 1335 Left = 2730 TabIndex = 7 Top = 960 Width = 2175 Begin OptionButton Option4 BackColor = &H00FFFFFF& Caption = "Right" ForeColor = &H00000000& Height = 315 Left = 1200 TabIndex = 11 Top = 870 Width = 795 End Begin OptionButton opt_left BackColor = &H00FFFFFF& Caption = "Left" ForeColor = &H00000000& Height = 285 Left = 1200 TabIndex = 10 Top = 390 Value = -1 'True Width = 795 End Begin OptionButton Option2 BackColor = &H00FFFFFF& Caption = "Bottom" ForeColor = &H00000000& Height = 345 Left = 180 TabIndex = 9 Top = 840 Width = 975 End Begin OptionButton Option1 BackColor = &H00FFFFFF& Caption = "Top" ForeColor = &H00000000& Height = 315 Left = 180 TabIndex = 8 Top = 390 Width = 855 End End Begin ctPUSH ctPush BackColor = &H00C0C0C0& BevelSize = 2 ButtonHeight = 69 ButtonWidth = 87 Caption = "OK" DisableColor = &H00808080& FocusBorder = 0 'False ForeColor = &H00000000& Height = 1035 Left = 510 MultiLine = 0 'None PicBevel = 1 PicExpand = 0 'False PicOnly = 0 'False PicPosition = 3 'Left Picture = CT_PUSH.FRX:0302 PictureDisabled = CT_PUSH.FRX:050C PicXOffset = 0 PicYOffset = 0 RepeatRate = 0 RoundCorners = -1 'True State = -1 'True TabIndex = 4 TextXOffset = 0 TextYOffset = 0 Toggle = 0 'False Top = 960 Width = 1305 End Begin ctPUSH btn_tog3 BackColor = &H00C0C0C0& BevelSize = 2 ButtonHeight = 43 ButtonWidth = 41 Caption = "#3" DisableColor = &H00808080& FocusBorder = 0 'False FontBold = 0 'False FontItalic = 0 'False FontName = "Arial" FontSize = 8.25 FontStrikethru = 0 'False FontUnderline = 0 'False ForeColor = &H00000000& Height = 645 Left = 1680 MultiLine = 0 'None PicBevel = 1 PicExpand = 0 'False PicOnly = 0 'False PicPosition = 1 'Top Picture = CT_PUSH.FRX:0716 PictureDown = CT_PUSH.FRX:07E0 PicXOffset = 0 PicYOffset = 0 RepeatRate = 0 RoundCorners = -1 'True State = -1 'True TabIndex = 3 TextXOffset = 0 TextYOffset = 0 Toggle = -1 'True Top = 3570 Width = 615 End Begin ctPUSH btn_tog2 BackColor = &H00C0C0C0& BevelSize = 2 ButtonHeight = 43 ButtonWidth = 41 Caption = "#2" DisableColor = &H00808080& FocusBorder = 0 'False FontBold = 0 'False FontItalic = 0 'False FontName = "Arial" FontSize = 8.25 FontStrikethru = 0 'False FontUnderline = 0 'False ForeColor = &H00000000& Height = 645 Left = 1080 MultiLine = 0 'None PicBevel = 1 PicExpand = 0 'False PicOnly = 0 'False PicPosition = 1 'Top Picture = CT_PUSH.FRX:08AA PictureDown = CT_PUSH.FRX:0974 PicXOffset = 0 PicYOffset = 0 RepeatRate = 0 RoundCorners = -1 'True State = -1 'True TabIndex = 2 TextXOffset = 0 TextYOffset = 0 Toggle = -1 'True Top = 3570 Width = 615 End Begin ctPUSH btn_tog1 BackColor = &H00C0C0C0& BevelSize = 2 ButtonHeight = 43 ButtonWidth = 41 Caption = "#1" DisableColor = &H00808080& FocusBorder = 0 'False FontBold = 0 'False FontItalic = 0 'False FontName = "Arial" FontSize = 8.25 FontStrikethru = 0 'False FontUnderline = 0 'False ForeColor = &H00000000& Height = 645 Left = 480 MultiLine = 0 'None PicBevel = 1 PicExpand = 0 'False PicOnly = 0 'False PicPosition = 1 'Top Picture = CT_PUSH.FRX:0A3E PictureDown = CT_PUSH.FRX:0B08 PicXOffset = 0 PicYOffset = 0 RepeatRate = 0 RoundCorners = -1 'True State = -1 'True TabIndex = 1 TextXOffset = 0 TextYOffset = 0 Toggle = -1 'True Top = 3570 Width = 615 End Begin ctPUSH ctPush1 BackColor = &H00C0C0C0& BevelSize = 2 ButtonHeight = 61 ButtonWidth = 75 Caption = "E&xit from Demo" DisableColor = &H00808080& FocusBorder = 0 'False ForeColor = &H00000000& Height = 915 Left = 6300 MultiLine = 3 'Center PicBevel = 1 PicExpand = 0 'False PicOnly = 0 'False PicPosition = 1 'Top Picture = CT_PUSH.FRX:0BD2 PictureDown = CT_PUSH.FRX:0D3C PicXOffset = 0 PicYOffset = 2 RepeatRate = 0 RoundCorners = -1 'True State = -1 'True TabIndex = 0 TextXOffset = 0 TextYOffset = -2 Toggle = 0 'False Top = 3420 Width = 1125 End Begin Label txt_bevel Alignment = 2 'Center BackColor = &H00FFFFFF& BorderStyle = 1 'Fixed Single Caption = "1" ForeColor = &H00808080& Height = 375 Left = 4110 TabIndex = 18 Top = 2640 Width = 525 End Begin Label lbl_bevel BackColor = &H00FFFFFF& Caption = "Picture Bevel :" ForeColor = &H00808080& Height = 255 Left = 2730 TabIndex = 17 Top = 2700 Width = 1335 End Begin Label Label3 BackStyle = 0 'Transparent Caption = "The ctPUSH control has separate offset attributes for the text and picture. This makes it easier to get the proper look and feel for the buttons" FontBold = 0 'False FontItalic = 0 'False FontName = "MS Sans Serif" FontSize = 8.25 FontStrikethru = 0 'False FontUnderline = 0 'False ForeColor = &H00800000& Height = 1395 Left = 5310 TabIndex = 13 Top = 1020 Width = 2025 End Begin Label Label2 BackColor = &H00FFFFFF& Caption = "The following buttons have been set up in a toggle state. " ForeColor = &H00000000& Height = 495 Left = 2460 TabIndex = 6 Top = 3660 Width = 2655 End Begin Label Label1 Alignment = 2 'Center BackColor = &H00FFFFFF& BackStyle = 0 'Transparent Caption = "The ctPUSH VBX is a picture push button control. It allows the user to place a picture anywhere within the button. The control can accept three different images (up, down, and disabled) and can be set up as a toggle button." ForeColor = &H00800000& Height = 615 Left = 120 TabIndex = 5 Top = 120 Width = 7155 End Dim nBevel As Integer Sub btn_tog1_Click () If btn_tog1.State = False Then btn_tog2.State = True btn_tog3.State = True End If End Sub Sub btn_tog2_Click () If btn_tog2.State = False Then btn_tog1.State = True btn_tog3.State = True End If End Sub Sub btn_tog3_Click () If btn_tog3.State = False Then btn_tog2.State = True btn_tog1.State = True End If End Sub Sub Check1_Click () ctPush.PicOnly = Check1.Value If Check1.Value = False Then txt_bevel.Enabled = False ct_bevel.Enabled = False lbl_bevel.ForeColor = RGB(80, 80, 80) txt_bevel.ForeColor = RGB(80, 80, 80) Else txt_bevel.Enabled = True ct_bevel.Enabled = True lbl_bevel.ForeColor = RGB(0, 0, 0) txt_bevel.ForeColor = RGB(0, 0, 0) End If End Sub Sub Check2_Click () ctPush.PicExpand = Check2.Value End Sub Sub chk_disable_Click () If chk_disable.Value Then ctPush.Enabled = False Else ctPush.Enabled = True End If End Sub Sub ct_bevel_Click (nButton As Integer) If (nButton = 1) Then nBevel = Minimum(nBevel + 1, 15) Else nBevel = Maximum(nBevel - 1, 0) End If txt_bevel.Caption = LTrim(Str(nBevel)) ctPush.PicBevel = nBevel End Sub Sub ctPush1_Click () Unload w_push_demo End Sub Sub Form_Load () ' Center the window on the screen Move (Screen.Width - Width) / 2, (Screen.Height - Height) * .25 w_mdi_main.bt_push = BUTTON_DISABLE nBevel = 1 End Sub Sub Form_Unload (Cancel As Integer) w_mdi_main.bt_push = BUTTON_UP End Sub Function Maximum (x As Integer, y As Integer) If x > y Then Maximum = x Else Maximum = y End If End Function Function Minimum (x As Integer, y As Integer) If x < y Then Minimum = x Else Minimum = y End If End Function Sub opt_left_Click () ctPush.PicPosition = 3 End Sub Sub Option1_Click () ctPush.PicPosition = 1 End Sub Sub Option2_Click () ctPush.PicPosition = 2 End Sub Sub Option4_Click () ctPush.PicPosition = 4 End Sub