PS:the demo window flickers when resize it ,

Thanks, as for flicking honestly i have no clue how to fix this! It is not happening here Win7 x64?!leonhardt wrote:well done!
PS:the demo window flickers when resize it ,,SmartWindowRefresh doesn't work, Win7 32bit PB5.11
Thanks! appreciate your offered comments and i guess am affected by that syndrome as wellRichardL wrote:An excellent job, well done Said!
I offer the following comments with the caveats (a) after a short test it is so easy to overlook the obvious and (b) the “it is different so it's wrong” syndrome applies to most people, but me in particular![]()
- ComboBox() Cell - Yes please.
- Option for a single click to activate cell/s would be good. (I use this option with Srod's grid and prefer it.)
- I prefer not to press Return to leave text in a cell. (Option switch?)
- How do you recover a row that was accidentally shrunk to zero height?
- Numbers only/Letters only option for individual cells / rows / columns. 'Numbers only' to optionally allow a decimal point? Format mask ####.## would be superb!
- Could MyGrid_SetText() use the Pure Basic standard parameter order (Gadget#, X,Y,Text)
- The popup menu is not associated with the grid / cursor. I'm using multiple monitors and the grid can be on one and the popup can appear on the other.
Regards,
RichardL
Thanks, personally am not comfortable with using userlibs ( i have the feelings they are a great source of un-managed errorsmevedia.de wrote:Nice, there's just a small Bug if you collapse a Column (can't size it anymore). I could recommend you the Scroll Control.
Directly connect your Canvas and a Pointer to x/y Coordinates.
I use multiple monitors also and this quick fix worked fine.said wrote:- That multiple monitors issue is new to me! I will try to figure out what is going onRichardL wrote: - The popup menu is not associated with the grid / cursor. I'm using multiple monitors and the grid can be on one and the popup can appear on the other.
Regards,
RichardL![]()
Regards,
Said
Code: Select all
If _MyGrid_OverCellArea(*mg, x, y)
;DisplayPopupMenu(*mg\AttachedPopupMenu, WindowID(*mg\Window), x, y)
DisplayPopupMenu(*mg\AttachedPopupMenu, WindowID(*mg\Window));, x, y)
EndIf
Interestingskywalk wrote: I use multiple monitors also and this quick fix worked fine.![]()
Code: Select all
If _MyGrid_OverCellArea(*mg, x, y) ;DisplayPopupMenu(*mg\AttachedPopupMenu, WindowID(*mg\Window), x, y) DisplayPopupMenu(*mg\AttachedPopupMenu, WindowID(*mg\Window));, x, y) EndIf
Code: Select all
...
Case #PB_Shortcut_Return, #PB_Shortcut_F2
...
Nice tipmk-soft wrote:Cool, I'm VERY excited. Thank´s to shared.
[Edit]
I´m added 'F2' for starting edit
Changed in MyGrid_ManageEventCode: Select all
... Case #PB_Shortcut_Return, #PB_Shortcut_F2 ...
Code: Select all
...
Enumeration 1024 ; <- Check valid MenuItemID
#MyGrid_MenuEvent_Ctrl_C
#MyGrid_MenuEvent_Ctrl_V
#MyGrid_MenuEvent_Ctrl_X
EndEnumeration
Procedure.i MyGrid_ManageMenuEvent(Gdt.i, eType)
Protected *mg._MyGrid_Type = GetGadgetData(Gdt)
If GetActiveGadget() <> gdt
ProcedureReturn
EndIf
Select eType
Case #MyGrid_MenuEvent_Ctrl_C
If MyGrid_ShowCell(gdt, *mg\Row, *mg\Col)
SetClipboardText(MyGrid_GetText(gdt, *mg\Row, *mg\Col))
EndIf
Case #MyGrid_MenuEvent_Ctrl_V
If MyGrid_ShowCell(gdt, *mg\Row, *mg\Col)
MyGrid_SetText(gdt, *mg\Row, *mg\Col, GetClipboardText())
MyGrid_Redraw(gdt)
EndIf
Case #MyGrid_MenuEvent_Ctrl_X
If MyGrid_ShowCell(gdt, *mg\Row, *mg\Col)
SetClipboardText(MyGrid_GetText(gdt, *mg\Row, *mg\Col))
MyGrid_SetText(gdt, *mg\Row, *mg\Col, "")
MyGrid_Redraw(gdt)
EndIf
EndSelect
EndProcedure
;-{ Test
CompilerIf #PB_Compiler_IsMainFile
Enumeration
#Win_Nbr
#Grid_Nbr
#Grid_ColScroll
#Grid_RowScroll
#Grid_PopupMenu
#MenuItem_1
#MenuItem_2
#MenuItem_3
#MenuItem_4
#MenuItem_5
EndEnumeration
Global ii, iii, EvGd, Evnt, EvTp, EvMn
If OpenWindow(#Win_Nbr, 0, 0, 1000, 670, "MyGrid Said", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_ScreenCentered|#PB_Window_SizeGadget)
SetWindowColor(#Win_Nbr,#White)
If CreatePopupMenu(#Grid_PopupMenu) ; creation of the pop-up menu begins...
MenuItem(#MenuItem_1, "Show")
MenuItem(#MenuItem_2, "Hide")
MenuItem(#MenuItem_3, "Freeze here")
MenuBar()
OpenSubMenu("Sub-menu")
MenuItem(#MenuItem_4, "sub 1")
MenuItem(#MenuItem_5, "sub 2")
CloseSubMenu()
EndIf
MyGrid_New(#Win_Nbr, 0, #Grid_Nbr, #Grid_ColScroll, #Grid_RowScroll,10, 10, 920, 650,20000,100, #True)
; customize the grid ...
MyGrid_AttachPopup(#Grid_Nbr, #Grid_PopupMenu)
MyGrid_NoRedraw(#Grid_Nbr)
MyGrid_Col_Freeze(#Grid_Nbr, 3)
MyGrid_Row_Freeze(#Grid_Nbr, 5)
; example of extra style ( checkboxes at col# 9)
ii = _MyGrid_AddExtraStyle(GetGadgetData(#Grid_Nbr), #MyGrid_Align_Center, $E6D8AD,#Blue,Font_A8,#MyGrid_CellType_Checkbox,#True)
_MyGrid_SetExtraStyle(GetGadgetData(#Grid_Nbr), #MyGrid_RC_Data, 9, ii)
;MyGrid_Col_Hide(#Grid_Nbr, 0, 1)
;MyGrid_Row_Hide(#Grid_Nbr, 0, 1)
MyGrid_Col_Hide(#Grid_Nbr, 7, 1)
; Add ShortCut
AddKeyboardShortcut(#Win_Nbr, #PB_Shortcut_Control | #PB_Shortcut_C, #MyGrid_MenuEvent_Ctrl_C)
AddKeyboardShortcut(#Win_Nbr, #PB_Shortcut_Control | #PB_Shortcut_V, #MyGrid_MenuEvent_Ctrl_V)
AddKeyboardShortcut(#Win_Nbr, #PB_Shortcut_Control | #PB_Shortcut_X, #MyGrid_MenuEvent_Ctrl_X)
MyGrid_Redraw(#Grid_Nbr)
Repeat
EvGd = -1
EvTp = -1
EvMn = -1
Evnt = WaitWindowEvent()
Select Evnt
Case #PB_Event_SizeWindow
MyGrid_Resize(#Grid_Nbr, #PB_Ignore, #PB_Ignore, WindowWidth(#Win_Nbr) - 80, WindowHeight(#Win_Nbr) - 20)
Case #PB_Event_Gadget
EvGd = EventGadget()
EvTp = EventType()
Select EvGd
Case #Grid_Nbr
MyGrid_ManageEvent(EvGd, EvTp, 0)
Case #Grid_ColScroll
MyGrid_ManageEvent(#Grid_Nbr, EvTp, #Grid_ColScroll)
Case #Grid_RowScroll
MyGrid_ManageEvent(#Grid_Nbr, EvTp, #Grid_RowScroll)
EndSelect
Case #PB_Event_Menu
EvMn = EventMenu()
MyGrid_ManageMenuEvent(#Grid_Nbr, EvMn)
Select EvMn
Case #MenuItem_1 : Debug " popup menu 1 "
Case #MenuItem_2 : Debug " popup menu 2 "
Case #MenuItem_3 : Debug " popup menu 3 "
Case #MenuItem_4 : Debug " popup menu 4 "
Case #MenuItem_5 : Debug " popup menu 5 "
EndSelect
EndSelect
Until Evnt = #PB_Event_CloseWindow
EndIf
CompilerEndIf
;}