![]() This source file allows the programmer to utilise a small grid control within an application. If Ev = #Wm_Paint : DrawImage(Grid, xgrid, ygrid) : EndIfĬode: Select all PureGrid version 1.0 by Stephen Rodriguez. SetGadgetText(#Txt, "Selected " + Str(SEL)+s$+textcell$(sel-1)) If Len(t$): textcell$(sel - 1) = t$ : EndIf Until ev = #PB_Event_Menu And EventMenuID() = #Ret If TextLength(t$+"W")>wcell:Break:EndIf limit for text too long If #WM_LBUTTONDOWN : mk = 1 : Else : mk = 0 : EndIf MY = WindowMouseY() - GetSystemMetrics_(#SM_CYCAPTION) - GetSystemMetrics_(#SM_CYSIZEFRAME) ![]() MX = WindowMouseX() - GetSystemMetrics_(#SM_CYSIZEFRAME) If i > 0 And i % ncolumns = 0 : x = 0 : y + hcell : EndIf WGrid = WCell * NColumns + 1 : HGrid = HCell * NRows + 1 SmallFont = LoadFont(0, "Tahoma ", hcell/2) NColumns = 8 : NRows = 12 number of rows & columns Locate(xcell(i) + 2, ycell(i)+2) : DrawText(textcell$(i))ĪddKeyboardShortcut(0, #PB_Shortcut_Return, #Ret) Locate(x + 1, y+1) : DrawText(textcell$(SEL - 1)) Global Grid, Colum, Rows, _X, _Y, WCell, HCell, XGrid, YGrid, NColumns, NRows, NCells, WGrid, HGrid, SmallFont If Ev=#Wm_Paint : DrawImage(Grid, xgrid,ygrid) : EndIfĭim Selected.l(1): Dim textcell$(0) : Dim xcell.W(0) : Dim ycell.W(0) If SEL : SetGadgetText(2, "Selected " + Str(SEL)) : selected(0) = 0 : EndIf WGrid = WCell * NColumns+1 : HGrid = HCell * NRows+1 NColumns = 10 : NRows = 20 number of rows & columns ![]() HWnd = OpenWindow(0, 0, 0, _X, _Y, #WS_OVERLAPPEDWINDOW, "Grid") _X = GetSystemMetrics_(#SM_CXSCREEN) - 8 : _Y = GetSystemMetrics_(#SM_CYSCREEN) - 68 X = XGrid + (COLU - 1) * WCell + 1 : y = YGrid + ((ROW - 1) * HCell) + 1 If Selected(0) : CleanCell(SELECTED(0), Selected(1)) : EndIf ProcedureReturn mx >= x And my >= y And mx COLU Or Selected(1) ROW Global Grid, Colum, Rows, _X, _Y, WCell, HCell, XGrid, YGrid, NColumns, NRows, NCells, WGrid, HGrid,SmallFont ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |