?? uo_supperbutton.sru
字號(hào):
$PBExportHeader$uo_supperbutton.sru
forward
global type uo_supperbutton from commandbutton
end type
type tagrect from structure within uo_supperbutton
end type
type us_bitmap from structure within uo_supperbutton
end type
type pointapi from structure within uo_supperbutton
end type
type rect from structure within uo_supperbutton
end type
type toolinfo from structure within uo_supperbutton
end type
type msg from structure within uo_supperbutton
end type
type point from structure within uo_supperbutton
end type
end forward
type tagrect from structure
long left
long top
long right
long bottom
end type
type us_bitmap from structure
long bmtype
long bmwidth
long bmheight
long bmwidthbytes
long bmplanes
long bmbitspixel
blob bmbits
end type
type pointapi from structure
long x
long y
end type
type rect from structure
long left
long top
long right
long bottom
end type
type toolinfo from structure
unsignedlong cbsize
unsignedlong uflags
unsignedlong hwnd
unsignedlong uid
rect rect
unsignedlong hinstance
long lpsztext
end type
type msg from structure
unsignedlong hwnd
unsignedlong message
unsignedlong wparam
unsignedlong lparam
long time
point pt
end type
type point from structure
long x
long y
end type
global type uo_supperbutton from commandbutton
integer width = 279
integer height = 100
integer textsize = -9
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋體"
string text = "&OK"
event ue_paint pbm_paint
event ue_lbuttondown pbm_lbuttondown
event ue_mousemove pbm_mousemove
event ue_lbuttonup pbm_lbuttonup
event ue_size pbm_size
event ue_bnhilite pbm_askcbformatname
event ue_setstyle pbm_bmsetstyle
event ue_dbclk pbm_lbuttondblclk
event ue_keyup pbm_keyup
event ue_keydown pbm_keydown
event ue_enable pbm_enable
event readme ( )
end type
global uo_supperbutton uo_supperbutton
type prototypes
//功能修正增加(pcm)
FUNCTION ulong SetPixel(ulong hdc,ulong x2,ulong y2,ulong crColor) LIBRARY "gdi32.dll"
FUNCTION ulong MoveToEx(ulong hdc,ulong x1,ulong y1,ref POINTAPI lpPoint) LIBRARY "gdi32.dll"
FUNCTION ulong GetSystemMetrics(ulong nIndex) LIBRARY "user32.dll"
FUNCTION ulong DrawFocusRect(ulong hdc,ref tagrect lpRect) LIBRARY "user32.dll"
FUNCTION ulong InflateRect(ref tagrect lpRect,ulong x1,ulong y1) LIBRARY "user32.dll"
FUNCTION ulong FrameRect(ulong hdc,ref tagrect lpRect,ulong hBrush) LIBRARY "user32.dll"
FUNCTION ulong CopyRect(ref tagrect lpDestRect,ref tagrect lpSourceRect) LIBRARY "user32.dll"
//從指定窗口的結(jié)構(gòu)中取得信息
FUNCTION uLong GetWindowuLong(uLong hwnd, uLong nIndex) Alias For GetWindowLongA LIBRARY "USER32.DLL"
//在窗口結(jié)構(gòu)中為指定的窗口設(shè)置信息
FUNCTION uLong SetWindowuLong(uLong hwnd, uLong nIndex,uLong dwNewLong) Alias For SetWindowLongA LIBRARY "USER32.DLL"
//文本繪圖函數(shù)
//FUNCTION ulong TextOut(ulong hdc,ulong x,ulong y,ref string lpString,ulong nCount) LIBRARY "gdi32.dll" ALIAS FOR "TextOutA"
//內(nèi)存拷貝
//用指定的刷子填充一個(gè)矩形
FUNCTION ulong FillRect(ulong hdc,ref tagrect lpRect,ulong hBrush) LIBRARY "user32.dll"
//用純色創(chuàng)建一個(gè)刷子
FUNCTION ulong CreateSolidBrush(ulong crColor) LIBRARY "gdi32.dll"
//為任何一種標(biāo)準(zhǔn)系統(tǒng)顏色取得一個(gè)刷子
FUNCTION ulong GetSysColorBrush(ulong nIndex) LIBRARY "user32.dll"
//判斷指定windows顯示對(duì)象的顏色
FUNCTION ulong GetSysColor(ulong nIndex) LIBRARY "user32.dll"
//指定陰影刷子、虛線畫(huà)筆以及字符中的空隙的填充方式
FUNCTION ulong SetBkMode(ulong hdc,ulong nBkMode) LIBRARY "gdi32.dll"
//為指定的設(shè)備場(chǎng)景設(shè)置背景顏色。背景顏色用于填充陰影刷子、虛線畫(huà)筆以及字符(如背景模式為OPAQUE)中的空隙。也在位圖顏色轉(zhuǎn)換期間使用
FUNCTION ulong SetBkColor(ulong hdc,ulong crColor) LIBRARY "gdi32.dll"
//設(shè)置當(dāng)前文本顏色。這種顏色也稱為“前景色”
FUNCTION ulong SetTextColor(ulong hdc,ulong crColor) LIBRARY "gdi32.dll"
//將一幅位圖從一個(gè)設(shè)備場(chǎng)景復(fù)制到另一個(gè)。源和目標(biāo)DC相互間必須兼容。這個(gè)函數(shù)會(huì)在設(shè)備場(chǎng)景中定義一個(gè)目標(biāo)矩形,并在位圖中定義一個(gè)源圖象。源矩形會(huì)根據(jù)需要進(jìn)行伸縮,以便與目標(biāo)矩形的大小相符
//FUNCTION ulong StretchBlt(ulong hdc,ulong x,ulong y,ulong nWidth,ulong nHeight,ulong hSrcDC,ulong xSrc,ulong ySrc,ulong nSrcWidth,ulong nSrcHeight,ulong dwRop) LIBRARY "gdi32.dll"
//將文本描繪到指定的矩形中
FUNCTION ulong DrawText(ulong hdc,string lpStr,ulong nCount,ref tagrect lpRect,ulong wFormat) LIBRARY "user32.dll" ALIAS FOR "DrawTextA"
//用指定的樣式描繪一個(gè)矩形的邊框
FUNCTION boolean DrawEdge(ulong hdc,ref tagrect qrc,ulong edge,ulong grfFlags) LIBRARY "user32.dll"
//釋放由調(diào)用GetDC或GetWindowDC函數(shù)獲取的指定設(shè)備場(chǎng)景。它對(duì)類或私有設(shè)備場(chǎng)景無(wú)效(但這樣的調(diào)用不會(huì)造成損害)
FUNCTION ulong ReleaseDC(ulong hwnd,ulong hdc) LIBRARY "user32.dll"
//刪除專用設(shè)備場(chǎng)景或信息場(chǎng)景,釋放所有相關(guān)窗口資源
FUNCTION ulong DeleteDC(ulong hdc) LIBRARY "gdi32.dll"
//每個(gè)設(shè)備場(chǎng)景都可能有選入其中的圖形對(duì)象。其中包括位圖、刷子、字體、畫(huà)筆以及區(qū)域等等。一次選入設(shè)備場(chǎng)景的只能有一個(gè)對(duì)象。選定的對(duì)象會(huì)在設(shè)備場(chǎng)景的繪圖操作中使用。例如,當(dāng)前選定的畫(huà)筆決定了在設(shè)備場(chǎng)景中描繪的線段顏色及樣式
FUNCTION ulong SelectObject(ulong hdc,ulong hObject) LIBRARY "gdi32.dll"
//用這個(gè)函數(shù)刪除GDI對(duì)象,比如畫(huà)筆、刷子、字體、位圖、區(qū)域以及調(diào)色板等等。對(duì)象使用的所有系統(tǒng)資源都會(huì)被釋放
FUNCTION ulong DeleteObject(ulong hObject) LIBRARY "gdi32.dll"
//用指定的樣式、寬度和顏色創(chuàng)建一個(gè)畫(huà)筆
FUNCTION ulong CreatePen(ulong nPenStyle,ulong nWidth,ulong crColor) LIBRARY "gdi32.dll"
//為指定的設(shè)備場(chǎng)景指定一個(gè)新的當(dāng)前畫(huà)筆位置。前一個(gè)位置保存在lpPoint中
FUNCTION ulong MoveToEx(ulong hdc,ulong ix,ulong iy,ulong lpPoint) LIBRARY "gdi32.dll"
//用當(dāng)前畫(huà)筆畫(huà)一條線,從當(dāng)前位置連到一個(gè)指定的點(diǎn)。這個(gè)函數(shù)調(diào)用完畢,當(dāng)前位置變成x,y點(diǎn)
FUNCTION ulong LineTo(ulong hdc,ulong ix,ulong iy) LIBRARY "gdi32.dll"
//校驗(yàn)窗口的全部或部分客戶區(qū)。這樣便可告之windows指定的區(qū)域不需要重畫(huà)
//FUNCTION ulong ValidateRect(ulong hwnd,ref tagrect lpRect) LIBRARY "user32.dll"
//取回與某一設(shè)備場(chǎng)景相關(guān)的窗口的句柄
//FUNCTION ulong WindowFromDC(ulong hdc) LIBRARY "user32.dll"
//獲取指定窗口的設(shè)備場(chǎng)景
FUNCTION ulong GetDC(ulong hwnd) LIBRARY "user32.dll"
//載入一個(gè)位圖、圖標(biāo)或指針
FUNCTION ulong LoadImage(ulong hInst,string lpsz,ulong un1,ulong n1,ulong n2,ulong un2) LIBRARY "user32.dll" ALIAS FOR "LoadImageA"
//在指定的位置畫(huà)一個(gè)圖標(biāo)
//FUNCTION ulong DrawIcon(ulong hdc,ulong x,ulong y,ulong hIcon) LIBRARY "user32.dll"
FUNCTION boolean DrawIconEx(ulong hdc,ulong xLeft,ulong yTop,ulong hIcon,ulong cxWidth,ulong cyWidth,ulong istepIfAniCur,ulong hbrFlickerFreeDraw,ulong diFlags) LIBRARY "user32.dll"
//創(chuàng)建一幅與設(shè)備有關(guān)位圖,它與指定的設(shè)備場(chǎng)景兼容
//FUNCTION ulong CreateCompatibleBitmap(ulong hdc,ulong nWidth,ulong nHeight) LIBRARY "gdi32.dll"
//在指定的設(shè)備場(chǎng)景中設(shè)置一個(gè)像素的RGB值
//FUNCTION ulong SetPixel(ulong hdc,ulong x,ulong y,ulong crColor) LIBRARY "gdi32.dll"
FUNCTION ulong GetTextFace(ulong hdc,ulong nCount,ref string lpFacename) LIBRARY "gdi32.dll" ALIAS FOR "GetTextFaceA"
//FUNCTION ulong GetTextMetrics(ulong hdc,ref TEXTMETRIC lpMetrics) LIBRARY "gdi32.dll" ALIAS FOR "GetTextMetricsA"
//FUNCTION ulong CreateFontIndirect(ref LOGFONT lpLogFont) LIBRARY "gdi32.dll" ALIAS FOR "CreateFontIndirectA"
FUNCTION boolean DrawState(ulong hDC,ulong hBrush,ulong lpDrawStateProc,ulong lParam,ulong wParam,ulong n1,ulong n2,ulong n3,ulong n4,ulong un) LIBRARY "user32.dll" ALIAS FOR "DrawStateA"
FUNCTION ulong DestroyIcon(ulong hIcon) LIBRARY "user32.dll"
FUNCTION ulong Rectangle(ulong hdc,ulong X1,ulong Y1,ulong X2,ulong Y2) LIBRARY "gdi32.dll"
function long LoadLibrary( ref string lpLibFileName2 ) LIBRARY "KERNEL32" Alias For LoadLibraryA
function long FreeLibrary( long hinstance ) LIBRARY "KERNEL32"
FUNCTION ulong LoadBitmap(ulong hInstance, long lpBitmapName) LIBRARY "user32.dll" ALIAS FOR "LoadBitmapA"
FUNCTION ulong CreateDC(string lpDriverName,string lpDeviceName, string lpOutput, long lpInitData) LIBRARY "gdi32.dll" ALIAS FOR "CreateDCA"
FUNCTION ulong CreateCompatibleDC(ulong hdc) LIBRARY "gdi32.dll"
FUNCTION ulong GetPixel(ulong hdc,ulong ix,ulong iy) LIBRARY "gdi32.dll"
FUNCTION ulong LoadImage(ulong hInst,long lpsz,ulong un1,ulong n1,ulong n2,ulong un2) LIBRARY "user32.dll" ALIAS FOR "LoadImageA"
//if it's use in other version ,please modify by hand.
FUNCTION long FN_ResGetIconID(string lpLibFileName) LIBRARY "PBVM80.dll"
FUNCTION long FN_ResGetBitmapID(string lpLibFileName) LIBRARY "PBVM80.dll"
FUNCTION string FN_ResGetBitmapName(long lpLibFileName) LIBRARY "PBVM80.dll"
Function Long ImageList_Create (Long MinCx , Long MinCy , Long flags ,Long cInitial ,Long cGrow) Library "PBVM80.dll" ALIAS FOR "PBImageList_Create"
Function Long ImageList_AddMasked(Long hImageList ,Long hbmImage , Long crMask ) Library "PBVM80.dll" ALIAS FOR "PBImageList_AddMasked"
Function Long ImageList_GetIcon(Long hImageList , Long ImgIndex , Long hbmMask ) Library "PBVM80.dll" ALIAS FOR "PBImageList_GetIcon"
Function Long ImageList_Destroy(Long hImageList) Library "PBVM80.dll" ALIAS FOR "PBImageList_Destroy"
//ImageList 函數(shù)
//Function Long ImageList_Create (Long MinCx , Long MinCy , Long flags ,Long cInitial ,Long cGrow) Library "COMCTL32.DLL"
//Function Long ImageList_AddMasked(Long hImageList ,Long hbmImage , Long crMask ) Library "COMCTL32.DLL"
//Function Long ImageList_GetIcon(Long hImageList , Long ImgIndex , Long hbmMask ) Library "COMCTL32.DLL"
FUNCTION ulong RoundRect(ulong hdc,ulong X1,ulong Y1,ulong X2,ulong Y2,ulong X3,ulong Y3) LIBRARY "gdi32.dll"
FUNCTION ulong GetStockObject(ulong nIndex) LIBRARY "gdi32.dll"
function ulong SetCapture(ulong hwnd) library "user32.dll"
function boolean ReleaseCapture() library "user32.dll"
function ulong GetCapture() library "user32.dll"
//獲得整個(gè)窗口的范圍矩形,窗口的邊框、標(biāo)題欄、滾動(dòng)條及菜單等都在這個(gè)矩形內(nèi)
FUNCTION ulong GetWindowRect(ulong hwnd,ref tagRECT lpRect) LIBRARY "user32.dll"
//移動(dòng)矩形
FUNCTION ulong OffsetRect(ref tagrect lpRect,ulong xs,ulong ys) LIBRARY "user32.dll"
FUNCTION ulong GetClientRect(ulong hwnd,ref tagRECT lpRect) LIBRARY "user32.dll"
FUNCTION ulong DefWindowProc(ulong hwnd,ulong wMsg,ulong wParam,ulong lParam) LIBRARY "user32.dll" ALIAS FOR "DefWindowProcA"
//畫(huà)矩形函數(shù)
Function uLong CreateRectRgn(Long X1 , Long Y1 , Long X2 , Long Y2 ) LIBRARY "gdi32.dll"
Function uLong CombineRgn(Long hDestRgn, Long hSrcRgn1 , Long hSrcRgn2 , Long nCombineMode ) LIBRARY "gdi32.dll"
Function uLong SetWindowRgn(Long hwnd , Long hRgn , Boolean bRedraw ) LIBRARY "user32.dll"
/*提示信息顯示定義*/
//確保動(dòng)態(tài)鏈接庫(kù)(DLL)被加載
SubRoutine InitCommonControls() library "comctl32.dll"
//創(chuàng)建窗口
Function long CreateWindowExA(ulong dwExStyle,string ClassName, long WindowName, ulong dwStyle,ulong X4, ulong Y4, ulong nWidth, ulong nHeight, ulong hWndParent, ulong hMenu, ulong hInstance, ulong lpParam) library "user32.dll"
//清除指定的窗口以及它的所有子窗口
Function integer DestroyWindow(long hWnd) library "user32.dll"
//調(diào)用一個(gè)窗口的窗口函數(shù),將一條消息發(fā)給那個(gè)窗口
Function integer ToolTipMsg(long hWnd, long uMsg, long wParam, REF TOOLINFO ToolInfo) library "user32.dll" Alias For "SendMessageA"
//調(diào)用一個(gè)窗口的窗口函數(shù),將一條消息發(fā)給那個(gè)窗口
Function integer RelayMsg(long hWnd, long uMsg, long wParam, REF MSG Msg) library "user32.dll" Alias For "SendMessageA"
//分配指定數(shù)量的內(nèi)存
Function long LocalAlloc(long Flags, long Bytes) library "kernel32.dll"
//釋放內(nèi)存并使句柄無(wú)效
Function long LocalFree(long MemHandle) library "kernel32.dll"
//復(fù)制字符串到緩沖區(qū)
Function long lstrcpy(long Destination, string Source) library "kernel32.dll"
end prototypes
type variables
public:
//boolean 默認(rèn)焦點(diǎn) = false
boolean XP風(fēng)格 = false
long XP風(fēng)格類型 = 1
long XP風(fēng)格背景顏色 = 12632256
boolean 橢圓形狀 = false
boolean 邊框 = false
//long 邊框顏色 = rgb(0,128,192)
long 邊框顏色 = rgb(72,148,168)
boolean 凸起效果 = true
long 凸起效果顏色 = rgb(242,238,230)
boolean 凸起效果漸進(jìn)色背景 = true
long 凸起效果漸進(jìn)色結(jié)束=RGB(160,190,190)
long 凸起效果漸進(jìn)色開(kāi)始=RGB(255,255,255)
boolean 漸進(jìn)色背景 = true
boolean 水平漸進(jìn) = false
long 漸進(jìn)色結(jié)束=RGB(168,204,216)
long 漸進(jìn)色開(kāi)始=RGB(255,255,255)
boolean PB自帶圖片 = false
ToolBarAlignment 圖片排列方式 = Alignatleft!
string 正常狀態(tài)圖片 = "Custom038!"
String 鼠標(biāo)移入圖片 = "Custom038!"
long 鼠標(biāo)移入背景顏色 = rgb(242,238,230)
long 字體顏色 =rgb(0,0,0)
long 不可用狀態(tài)字體顏色=rgb(128,128,128)
long 鼠標(biāo)移入字體顏色 =rgb(0,0,0)
long 背景顏色
boolean 顯示提示信息 = false
string 提示信息
private:
long 系統(tǒng)顏色刷子
long 背景顏色刷子
ulong h_bmpBk,h_normalPic,h_movePic
boolean ib_captured = false
boolean ib_pushDown = false
integer ii_picsize
tagRect winRect
Private :
boolean ib_blup //修正按鈕up的時(shí)候還觸發(fā)mousemove
boolean 焦點(diǎn) = false
boolean ib_MouseOnButton
//-------------------------------------
//CONSTANT var
//SetBkMode
CONSTANT ulong TRANSPARENT = 1
//DrawEdge
CONSTANT uLong BDR_RAISEDOUTER = 1
CONSTANT uLong BDR_SUNKENOUTER = 2
CONSTANT uLong BDR_RAISEDINNER = 4
CONSTANT uLong BDR_SUNKENINNER = 8
CONSTANT uLong BDR_OUTER = 3
CONSTANT uLong BDR_INNER = 12
CONSTANT uLong BF_LEFT = 1
CONSTANT uLong BF_RIGHT = 4
CONSTANT uLong BF_TOP = 2
CONSTANT uLong BF_BOTTOM = 8
CONSTANT uLong BF_RECT = 1
//GetSysColor GetSysColorBrush
CONSTANT uLong COLOR_BACKGROUND=1
CONSTANT uLong COLOR_HIGHLIGHT= 13
CONSTANT uLong COLOR_HIGHLIGHTTEXT = 14
CONSTANT uLong COLOR_MENU = 4
CONSTANT uLong COLOR_WINDOW = 5
CONSTANT uLong COLOR_MENUTEXT = 7
CONSTANT uLong COLOR_WINDOWTEXT = 8
CONSTANT uLong COLOR_ACTIVECAPTION = 2
CONSTANT uLong COLOR_BTNFACE = 15
CONSTANT uLong COLOR_INFOBK = 24
Constant integer COLOR_BTNHIGHLIGHT = 20
Constant integer COLOR_BTNSHADOW = 16
//LoadImage
CONSTANT uLong IMAGE_BITMAP = 0
CONSTANT uLong IMAGE_ICON = 1
CONSTANT uLong IMAGE_CURSOR = 2
CONSTANT uLong IMAGE_ENHMETAFILE = 3
CONSTANT uLong LR_DEFAULTCOLOR = 0
CONSTANT uLong LR_MONOCHROME = 1
CONSTANT uLong LR_COLOR = 2
CONSTANT uLong LR_COPYRETURNORG = 4
CONSTANT uLong LR_COPYDELETEORG = 8
CONSTANT uLong LR_LOADFROMFILE = 16
CONSTANT uLong LR_LOADTRANSPARENT = 32
CONSTANT uLong LR_DEFAULTSIZE = 64
CONSTANT uLong LR_VGACOLOR = 128
CONSTANT uLong LR_LOADMAP3DCOLORS = 4096
CONSTANT uLong LR_CREATEDIBSECTION = 8192
CONSTANT uLong LR_COPYFROMRESOURCE = 16384
CONSTANT uLong LR_SHARED = 32768
//CreatePen
CONSTANT uLong PS_SOLID = 0
//
CONSTANT uLong SRCCOPY = 13369376
//DrawText
CONSTANT uLong DT_LEFT = 0
CONSTANT uLong DT_CENTER = 1
CONSTANT uLong DT_RIGHT = 2
CONSTANT uLong DT_VCENTER = 4
CONSTANT uLong DT_BOTTOM = 8
CONSTANT uLong DT_SINGLELINE = 32
CONSTANT uLong DT_CALCRECT = 1024
CONSTANT uLong DT_WORDBREAK = 16
Constant integer DST_ICON = 3
Constant integer DST_BITMAP =4
Constant integer DSS_NORMAL =0
Constant integer DSS_DISABLED = 32
Constant integer DSS_MONO = 128
Constant integer DSS_UNION = 16
Constant int SM_CYMENU = 15
Constant int SM_CXMENUCHECK = 71
//use in GetStockObject
Constant int WHITE_BRUSH=0
Constant int GRAY_BRUSH =1
Constant int LTGRAY_BRUSH=2
Constant int DKGRAY_BRUSH=3
Constant int BLACK_BRUSH=4
Constant int NULL_BRUSH=5
Constant int WHITE_PEN=6
Constant int BLACK_PEN=7
Constant int NULL_PEN=8
Constant int OEM_FIXED_FONT=10
Constant int ANSI_FIXED_FONT=11
Constant int ANSI_VAR_FONT=12
Constant int SYSTEM_FONT=13
Constant int WM_GETFONT = 49
constant Long RGN_DIFF = 4
constant Long SM_CXICON = 11
constant Long SM_CYICON = 12
//提示信息顯示定義
Private:
// Constants
CONSTANT string TOOLTIPS_CLASS = 'tooltips_class32'
CONSTANT ulong CW_USEDEFAULT = 2147483648
CONSTANT long WM_USER = 1024
CONSTANT long WS_EX_TOPMOST = 8
// ToolTip Messages
CONSTANT long TTM_ADDTOOL = WM_USER + 4
CONSTANT long TTM_RELAYEVENT = WM_USER + 7
long hWndTT
// Tooltip control window handle
long ToolID = 1 // Tooltip internal ID
// Tooltip flags
constant long TOOLINFO_SIZE = 40
CONSTANT integer TTF_CENTERTIP = 2
CONSTANT integer TTF_RTLREADING = 4
//CONSTANT integer TTF_DI_SETITEM = 32768
//CONSTANT long TTM_NEWTOOLRECT = WM_USER + 6
CONSTANT integer TTS_BALLOON = 64
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -