
I'll check it out soon. Finishing a big project this weekend....
Code: Select all
Procedure xGrid_Resize(GadgetNumber.l, x.l, y.l, Width.l, Height.l) ; Pass -1 to leave values unchanged.
;
HoldWidth.l
;
Protected *xGrid.s_xGrid
;
*xGrid = xg_PointerFromNumber(GadgetNumber) ; <===== *xGrid = 0
; Fill our xGrid structure.
If X = -1 : X = *xGrid\X : EndIf
If Y = -1 : Y = *xGrid\Y : EndIf
If Width = -1 : Width = *xGrid\Width : EndIf
If Height = -1 : Height = *xGrid\Height : EndIf
;
*xGrid\Width = Width - 21 : *xGrid\Height = Height - 21 ; <==== Pointer is null
; ........
EndProcedure
Code: Select all
Procedure xGrid_Resize(GadgetNumber.l, X.l, Y.l, Width.l, Height.l) ; Pass -1 to leave values unchanged.
;
HoldWidth.l
;
Protected *xGrid.s_xGrid
;
*xGrid = xg_PointerFromNumber(GadgetNumber)
; Fill our xGrid structure.
If *xGrid
;
If X = -1 : X = *xGrid\X : EndIf
If Y = -1 : Y = *xGrid\Y : EndIf
If Width = -1 : Width = *xGrid\Width : EndIf
If Height = -1 : Height = *xGrid\Height : EndIf
;
*xGrid\Width = Width - 21 : *xGrid\Height = Height - 21
; Make allowances for the size of the scrollbars.
*xGrid\TotalWidth = Width : *xGrid\TotalHeight = Height
; Store the size of the grid control, including the scrollbars.
SetGadgetState(*xGrid\GadgetNumber, 0)
;
FreeImage(*xGrid\Handles\Image)
;
*xGrid\Handles\Image = CreateImage(#PB_Any, *xGrid\Width, *xGrid\Height)
;
ResizeGadget(*xGrid\GadgetNumber, X, Y, *xGrid\Width, *xGrid\Height)
;
SetGadgetState(*xGrid\GadgetNumber, UseImage(*xGrid\Handles\Image))
;
HoldWidth = Int(*xGrid\TotalWidth * 0.5)
;
MoveWindow_(*xGrid\Handles\ScrollHorizontal, HoldWidth + 5, Y + *xGrid\Height + 4, *xGrid\Width - HoldWidth, 16, #True)
MoveWindow_(*xGrid\Handles\ScrollVertical, X + *xGrid\Width + 4, Y, 16, *xGrid\Height + 4, #True)
MoveWindow_(*xGrid\Handles\Tabs, X, Y + *xGrid\Height + 6, HoldWidth - 5, 16, #True)
;
SetRect_(@*xGrid\CellDimensions, -1, -1, -1, -1)
; Invalidate our cell dimensions.
xg_UpdateMaxDimensions(*xGrid, #True, #True)
; Update with our new maximum width and height.
xg_DrawGrid(*xGrid)
;
EndIf
;
EndProcedure
Code: Select all
ElseIf Message = #WM_LBUTTONDBLCLK Or Message = #WM_RBUTTONUP
; User pressed the right mouse button or double-clicked a tab. Popup custom box to modify tabs.
If (Message = #WM_RBUTTONUP And *xGrid\Events\PopTab) Or (Message = #WM_LBUTTONDBLCLK And *xGrid\Events\TabDClick)
; Make sure we have an event defined for the right-click/double-click action.
HoldIndex = SendMessage_(HandleWindow, #TCM_GETCURSEL, 0, 0)
;
HoldString = Space(255)
;
HoldItem\Mask = #TCIF_TEXT
HoldItem\pszText = @HoldString
HoldItem\cchTextMax = 255
SendMessage_(HandleWindow, #TCM_GETITEM, HoldIndex, @HoldItem)
;
If Message = #WM_LBUTTONDBLCLK
CallFunctionFast(*xGrid\Events\TabDClick, HoldIndex, HoldString)
Else
CallFunctionFast(*xGrid\Events\PopTab, HoldIndex, HoldString)
EndIf
;
EndIf
;
EndIf
;
*xGrid\Keys\EndDown = #False ; <=========== Pointer is null
;
lResult = CallWindowProc_(*xGrid\Controls\TabCallback, HandleWindow, Message, wParam, lParam)
;
Code: Select all
ElseIf MouseLocation = #xGrid_MouseInCells
; We're in a grid cell.
SetCursor_(xg_HandleSelectCell) : ReturnTrue = #True
;
If xg_IsCellSelected(*xGrid, *xGrid\CellLocation\X, *xGrid\CellLocation\Y) = #False
; Check if the cell is already selected.
xg_ForceSelect(*xGrid, *xGrid\CellLocation\X, *xGrid\CellLocation\Y, #False)
; Select the cell.
EndIf
;
If *xGrid\Events\PopCells : CallFunctionFast(*xGrid\Events\PopCells) : EndIf
;
EndIf
;}
;
EndIf
;
If ReturnTrue : ProcedureReturn ReturnTrue : EndIf
; If we're handling the event, we'll need to let the procedure know not to continue.
lResult = CallWindowProc_(*xGrid\OldCallback, HandleWindow, Message, wParam, lParam) ; <=========== Pointer is null
;
ProcedureReturn lResult
;
EndProcedure
I don't mindXombie wrote:Thanks for the heads-up and I hope you don't mind me using you as a test subject for windows 98 compatability.