mentorgift.blogg.se

Purebasic new gadget color
Purebasic new gadget color








purebasic new gadget color

Really good codes become very large and complicated to code very quickly The next days there will be a whole bag of new incredible text functions for and without gadgets.Ĭustom gadgets are often created canvas based.īut if you want the perfect look and feel of the OS, there is no way around ButtonImageGadgets.įor your problem just look for StretchText Gadget, or any other Several authors, as well as myself, develop new functions and add extensions for the GFX_Wizzard_BF. The first address for such things is the GFX_Wizzard_BF, which you can not deny. Well, of course it is not so easy to find something suitable, these things are often well hidden. Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow StopDrawing() : ok=ButtonImageGadget(gad,x,y,w,h,ImageID(text),flags) If font=#PB_Default : font=GetStockObject_(#DEFAULT_GUI_FONT) : EndIfĭrawText(w/2-TextWidth(text$)/2,h/2-TextHeight(text$)/2,text$,fgcolor,bgcolor) If fgcolor=#PB_Default : fgcolor=GetSysColor_(#COLOR_BTNFACE) : EndIf If bgcolor=#PB_Default : bgcolor=GetSysColor_(#COLOR_BTNFACE) : EndIf SendMessage_(GadgetID(0), #LVM_GETITEMRECT, 0, r.Code: Select all Procedure ButtonGadgetColor(gad,x,y,w,h,text$="",flags=0,fgcolor=#PB_Default,bgcolor=#PB_Default,font=#PB_Default) TextOut_(*lvCD\nmcd\hdc,subItemRect.RECT\left+2,subItemRect.RECT\top, Len(Text$)) TextOut_(*lvCD\nmcd\hdc,subItemRect.RECT\left + rh+2,subItemRect.RECT\top, Len(Text$))

purebasic new gadget color

SendMessage_(GadgetID(0), #LVM_GETSUBITEMRECT, thisRow, $0)ĭrawIconEx_(*lvCD\nmcd\hdc,subItemRect.RECT\left,subItemRect.RECT\top+1,Ico(thisRow),rh-4,rh-4,1,0,#DI_NORMAL) If *nmhdr\hWndFrom = GetWindow_(GadgetID(0),#GW_CHILD) And *nmhdr\code = #HDN_FIRST If GetAsyncKeyState_(#VK_CONTROL) & 32768 32768 And EventwParam() = #VK_ESCAPE And Edit = 1ĭebug GetGadgetItemText(0,item-1,subitem) SetGadgetItemText(0,item-1,GetGadgetText(1),subitem) If GetAsyncKeyState_(#VK_CONTROL) & 32768 32768 And EventwParam() = #VK_RETURN And Edit = 1 R\right = GetGadgetItemAttribute(0,0,#PB_ListIcon_ColumnWidth,0) - r\left SendMessage_(GadgetID(0), #LVM_GETSUBITEMRECT, li\iItem, r) If GetAsyncKeyState_(#VK_CONTROL) & 32768 = 32768 And EventwParam() = #VK_RETURN SetGadgetItemColor(0,item-1, #PB_Gadget_BackColor,GetSysColor_(#COLOR_HIGHLIGHT),subitem-1) SetGadgetItemColor(0,item-1,#PB_Gadget_FrontColor,$E1E1E1 ,subitem-1) SetGadgetItemColor(0,item-2, #PB_Gadget_BackColor,GetSysColor_(#COLOR_HIGHLIGHT),subitem)ĮlseIf EventwParam() = #VK_RIGHT And subitem = 1 SetGadgetItemColor(0,item-2,#PB_Gadget_FrontColor,$E1E1E1 ,subitem) SetGadgetItemColor(0,item-1, #PB_Gadget_BackColor,$E1E1E1,subitem) SetGadgetItemColor(0,item-1,#PB_Gadget_FrontColor,#Black ,subitem) ListIconGadget(0, 10, 10, 680, 455, "Column 0", 200, #PB_ListIcon_FullRowSelect | #PB_ListIcon_GridLines | #PB_ListIcon_AlwaysShowSelection)Īddtext$ = "Column 0 item # " + Str(a) + Chr(10) + "Column 1 item # " + Str(a) + Chr(10) + "Column 2 item # " + Str(a) If OpenWindow(0, 0, 0, 700, 500, "Set Select Color", #PB_Window_SystemMenu|#PB_Window_ScreenCentered | #PB_Window_SizeGadget) TextOut_(*lvCD\nmcd\hdc,subItemRect.RECT\left+2,subItemRect.RECT\top -2, Len(Text$)) TextOut_(*lvCD\nmcd\hdc,subItemRect.RECT\left + 18,subItemRect.RECT\top-2, Len(Text$)) Text$ = GetGadgetItemText(0,thisRow,thisCol)ĭrawIconEx_(*lvCD\nmcd\hdc,subItemRect.RECT\left,subItemRect.RECT\top+3,Ico(thisRow),16,16,1,0,#DI_NORMAL) SendMessage_(GadgetID(0), #LVM_GETSUBITEMRECT, thisRow, GetGadgetState(0) = thisRowįillRect_(*lvCD\nmcd\hdc, subItemRect, PlainBrush)įillRect_(*lvCD\nmcd\hdc, subItemRect, ColorBrush) If *lvCD\nmcd\hdr\hwndFrom=GadgetID(0) And *lvCD\nmcd\hdr\code = #NM_CUSTOMDRAW ResizeGadget(0,#PB_Ignore, #PB_Ignore,WindowWidth(0)-20,WindowHeight(0)-60) Procedure WindowCallback(hwnd, msg, wParam, lParam) ColorBrush = CreatePatternBrush_(ImageID(0))










Purebasic new gadget color