![]() ![]() 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) You can change everything by hand, but primarily you don't have to do anything at all, it always fits.ColorBrush = CreatePatternBrush_(ImageID(0)) The text size is adjusted automatically, also the alignment and padding. The same with the Font Flags, you can specify them, but you don't have to. ![]() Yes and you don't need to load any fonts at all, if you want to use a special one, just enter its name. The problems start with the automatic fitting of the text, text length and text size for multiline texts and continue with the fitting and alignment of the text. 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 Code: Select all Procedure ButtonGadgetColor(gad,x,y,w,h,text$="",flags=0,fgcolor=#PB_Default,bgcolor=#PB_Default,font=#PB_Default) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |