#define DEBUG #define WIN_INCLUDEALL #include "fbgfx.bi" #Include "windows.bi" #include "win\commctrl.bi" #include "win\gdiplus.bi" 'Global Styles #Define WinExtFontSize 16 #Define WinExtFontName "Terminal" #Define WinExtBkBrush &hAAAABB 'Button Text alignment #Define TextRight &h0000 #Define TextLeft &h0001 'FontStyles #Define Regular &h00 #Define Italic &h01 #Define Bold &h02 #Define Underline &h04 #Define StrikeOut &h08 'ID's #Define WindowID "WINDOW" #Define BitmapID "BITMAPIMAGE" #Define GroupBoxID "GROUPBOX" #Define SpinBoxID "SPINBOX" #Define EditBoxID "EDITBOX" #Define CheckBoxID "CHECKBOX" #Define ImageComboID "IMAGECOMBOBOX" #Define FontSelectComboID "FONTSELECTCOMBOBOX" #Define StaticTextID "STATICTEXT" #Define RadioButtonID "RADIOBUTTON" Using GDIPLUS Type Item as Item_Node ptr 'forward reference Type Item_Node EXTENDS OBJECT 'Item Head as String ID as String Title as HWND whwnd as Item NextItem as Item PrevItem Declare ABSTRACT Sub Destroy() End Type Type Item_List as Item FirstItem as Item LastItem as UInteger CountItem Declare Sub AddItem(byref ThisItem as Item) Declare Sub DelItem(byref ThisItem as Item) End Type Namespace Globals Dim as Item_List ItemList Dim as HINSTANCE hInstance Dim as String ClassName Dim as HBRUSH WinExtBrush Dim as HWND tabstophandle Dim as ULONG_PTR gdiplusToken Dim as byte ptr KeyState Dim as HKL KeyLayout Dim as HFONT hFont Dim as LOGFONT LogFont End Namespace Type Item_Window EXTENDS Item_Node as String WindowKey Declare Sub Destroy() End Type Type Item_Bitmap EXTENDS Item_Node 'Node for static control as SS_BITMAP as Item parent as GPBITMAP ptr Origin 'copy from original Image as HBITMAP Image 'the Image which put on screen as Integer cWidth 'Width of control as Integer cHeight 'Height of control Declare Sub Destroy() End Type Type Item_Group EXTENDS Item_Node as Integer FontColor as Integer FontBkColor as HBRUSH FontBrush Declare Sub Destroy() End Type Type Item_Spin EXTENDS Item_Node as HWND shwnd 'handle to UpDown control as Integer minVal as Integer maxVal Declare Sub Destroy() End Type Type Item_ImageCombo EXTENDS Item_Node as HBITMAP ptr IList as Integer ICount as Integer iState as Integer wSizeMode as Integer hSizeMode as Integer iWidth as Integer iHeight Declare Sub Destroy() End Type Type Item_FontSelectCombo EXTENDS Item_Node as Integer wSizeMode as Integer hSizeMode as Integer iWidth as Integer iHeight as Integer iState as Integer iCount Declare Sub Destroy() End Type Type Item_StaticText EXTENDS Item_Node as HFONT Font as Integer FColor as Integer BColor as HBRUSH BckBrush Declare Sub Destroy() End Type Type Item_RadioButton EXTENDS Item_Node as Item ghwnd 'Handle to the First RadioButton in Group as Item mhwnd 'Handle to the Window/GroupBox as Integer TextAlign as Integer FirstID 'ID to the first RadioButton as Integer LastID 'ID to the last RadioButton as Integer NowID 'Actually RadioButton ID Declare Sub Destroy() End Type 'Win_Ext Basics Declare Function WinExtProc(byval h_Wnd as HWND, byval u_Msg as UINT, byval wParam as WPARAM, byval lParam as LPARAM) as LRESULT Declare Function Convert_RGB_To_BGR(byval RGBValue as Integer) as Integer Declare Function GetWindowKey(byref ThisItem as Item) as String Declare Sub Win_Ext_Update(byval break as integer = 0) Declare Sub DisableItem (byref ItemHandle as Item) Declare Sub EnableItem(byref ItemHandle as Item) Declare Sub HideItem (byref ItemHandle as Item) Declare Sub ShowItem (byref ItemHandle as Item) #Include "win_ext.bas" 'ImageFunctions Declare Function CreateCopy_GDIImage_As_WINImage(byref GDIImage as any ptr) as HBITMAP Declare Function CreateCopy_GDIImage_As_FBImage(byref GDIImage as any ptr) as any ptr Declare Function CreateCopy_WINImage_As_GDIImage(byref WINImage as HBITMAP) as any ptr Declare Function CreateCopy_WINImage_As_FBImage(byref WINImage as HBITMAP) as any ptr Declare Function CreateCopy_FBImage_As_GDIImage(byref FBImage as any ptr) as any ptr Declare Function CreateCopy_FBImage_As_WINImage(byref FBImage as any ptr) as HBITMAP Declare Function LoadFBImage(byval Filename as String) as any ptr Declare Function LoadGDIImage(byval Filename as String) as any ptr Declare Function LoadWINImage(byval Filename as String, byval BackColor as Integer = -1) as HBITMAP Declare Function SaveGDIImage(byref GDIImage as any ptr, byval Filename as String, byval itype as String = "AUTO") as Integer Declare Function SaveWINImage(byref WINImage as HBITMAP, byval Filename as String, byval itype as String = "AUTO") as Integer Declare Function SaveFBImage(byref FBImage as any ptr, byval Filename as String, byval itype as String = "AUTO") as Integer Declare Function GetRect_From_FBImage(byref FBImage as any ptr, byval fromX as Integer, byval fromY as Integer, byval iWidth as Integer, byval iHeight as Integer) as any ptr Declare Function GetRect_From_GDIImage(byref GDIImage as any ptr, byval fromX as Integer, byval fromY as Integer, byval iWidth as Integer, byval iHeight as Integer) as any ptr Declare Function GetRect_From_WINImage(byref WINImage as HBITMAP, byval fromX as Integer, byval fromY as Integer, byval iWidth as Integer, byval iHeight as Integer) as HBITMAP Declare Sub DeleteWINImage(byref Image as HBITMAP) Declare Sub DeleteGDIImage(byref Image as any ptr) Declare Sub DeleteFBImage(byref Image as any ptr) #include "ImageFunctions.bas" 'Windows Declare Function CreateNewWindow(byval w as Integer, byval h as Integer, byval t as String = "", byval x as integer = 0, byval y as integer = 0, byval s as UInteger = 0, byval se as UInteger = 0) as Item #include "CreateNewWindow.bas" 'ImageItem Declare Function ReplaceImageItem(byref ItemHandle as Item, byval newImage as HBITMAP) as Integer Declare Function ResizeImageItem(byref ItemHandle as Item, byval newWidth as UInteger = 0, byval newHeight as Uinteger = 0) as Integer Declare Function CreateImageItem(byref ItemHandle as Item, byref ImageHandle as HBITMAP, byval px as Integer, byval py as Integer, byval iWidth as UInteger = 0, byval iHeight as UInteger = 0) as Item #include "CreateImageItem.bas" 'SpinBox Declare Function CreateSpinBox(byref ItemHandle as Item, byval px as Integer, byval py as Integer, byval iWidth as UInteger = 70, byval iHeight as UInteger = 25, byval minVal as Integer = 0, byval maxVal as Integer = 255, byval curVal as Integer = 0) as Item Declare Function GetSpinBoxValue(byval SpinBox as Item) as Integer #include "CreateSpinBox.bas" 'GroupBox Declare Function CreateGroupBox(byref ItemHandle as Item, byval px as integer, byval py as integer, byval w as integer, byval h as integer, byval title as string = "", byval FontColor as Integer = &h000000, byval FontBkColor as Integer = TRANSPARENT) as Item #include "CreateGroupBox.bas" 'EditBox Declare Function CreateEditBox(byref ItemHandle as Item, byval px as Integer, byval py as Integer, byval iWidth as UInteger = 125, byval txt as String="") as Item #include "CreateEditBox.bas" 'CheckBox Declare Function CreateCheckBox(byref ItemHandle as Item, byval px as Integer, byval py as Integer, byval txt as String="", byval TextAlign as Integer = TextRight) as Item Declare Function GetCheckBoxState(byref ItemHandle as Item) as Integer Declare Sub SetCheckBoxState(byref ItemHandle as Item, byval State as Integer) #include "CreateCheckBox.bas" 'ImageCombo Declare Function CreateImageComboBox(byref ItemHandle as Item, byval px as Integer, byval py as Integer, byval iWidth as UInteger = 0, byval iHeight as UInteger = 0) as Item Declare Function AddImageComboBox(byref ImageCombo as Item, byref Image as HBITMAP) as Integer Declare Function GetImageComboBox(byref ImageCombo as Item) as Integer Declare Function SetImageComboBox(byref ImageCombo as Item, byval ID as Integer) as Integer #include "CreateImageComboBox.bas" 'FontSelectCombo Declare Function CreateFontSelectCombo(byref ItemHandle as Item, byval px as Integer, byval py as Integer, byval iWidth as Integer = 0, byval iHeight as Integer = 0) as Item Declare Function AddFontSelectCombo(byref ItemHandle as Item, byval FontName as String) as Integer Declare Function EnumFontFamiliesExProc(byval lpelfe as ENUMLOGFONTEX ptr, byval lpntme as NEWTEXTMETRICEX ptr, byval FontType as Integer, byval lParam as LPARAM) as Integer #include "CreateFontSelectCombo.bas" 'StaticText Declare Function CreateStaticText(byref ItemHandle as Item, byval px as Integer, byval py as Integer, byval TxT as String, byval Font as String = "", byval FontStyle as UInteger = 0, byval FontSize as Integer = 16, byval FColor as Integer = 0 , byval BColor as Integer = TRANSPARENT) as Item #include "CreateStaticText.bas" 'RadioButton Declare Function CreateRadioButton(byref ItemHandle as Item, byref GroupHandle as Item, byval px as Integer, byval py as Integer, byval txt as String="", byval TextAlign as UInteger = TextRight) as Item Declare Function RadioButtonGroup(byref ItemHandle as Item, byval px as Integer, byval py as Integer, byval txt as String="", byval TextAlign as Integer = TextRight) as Item Declare Function RadioButtonAdd(byref GroupHandle as Item, byval px as Integer, byval py as Integer, byval txt as String="") as Item Declare Function GetRadioButtonState(byref ItemHandle as Item) as Integer Declare Sub SetRadioButtonState(byref ItemHandle as Item, byval State as Integer) #include "CreateRadioButton.bas"