Hello All,
I have been mostly away for several weeks but am back.
Thanks to all of your expert help I now have a basic solution that:
1) Uses the
HMG IDE.
2) Uses a
.DBF table as the Grid's ControlSource.
3) Displays an "imitation
CheckBox" in the Grid column (that works well enough).
4) Toggles the "CheckBox"
only on mouse clicks in the
proper Grid column.
Thank you Mustafa. Using your kind example I was able to add an additional "imitation CheckBox" column.
It took me some time but I was eventually able to filter for
only mouse clicks in the "CheckBox" column.
My solution uses function
_GetGridCellData() in the Grid's
OnChange Event.
Code: Select all
// DataBrowse_BrowseStates_OnChange
#include "hmg.ch"
#include "dll.ch"
#xtranslate DllCall => HMG_CallDLL // Lock and Unlock screen
declare window DataBrowse
FUNCTION DataBrowse_BrowseStates_OnChange()
LOCAL laCell := {} // A 6-element Grid cell array: #1 = Grid Row, #2 = Grid Col, ...
LOCAL lnLockwHDL := 0 // Hdl
lnLockwHDL := GetFormHandle( "DataBrowse" ) // Lock
IF ( IsControlContextMenuDefined( "BrowseStates", "DataBrowse" ) )
// See: DataBrowse_OnInit.PRG
ReleaseControlContextMenu( "BrowseStates", "DataBrowse" )
ENDIF
IF ( IsWindowDefined( "DataBrowse" ) .AND. IsWindowActive( "DataBrowse" ) )
laCell := _GetGridCellData( GetControlIndex( "BrowseStates", "DataBrowse" ) )
// Toggle value only if one of the 2 Merge columns are clicked:
// Column 1 = The imitation "CheckBox"
// Column 2 = Field MergeState is the actual ControlSource
IF ( laCell[ 2 ] <= 2 )
IF ( ! ( DataBrowse.BrowseStates.RecNo == Recno() ) )
By_State->( DbGoTo( DataBrowse.BrowseStates.RecNo ) )
ENDIF
Replace By_State->MergeState with ( ! By_State->MergeState )
// Must update grid's display:
DoMethod ("DataBrowse", "BrowseStates", "Refresh")
ENDIF
ENDIF
DllCall( "user32.dll", DLL_OSAPI, "LockWindowUpdate", 0 ) // Unlock
RETURN Nil
QUESTION:
How can I include those
NECESSARY Grid IMAGE
.BMP files into my .EXE?
(Adding them into the Resource.RC file was not successful).
Thank you all for your expert and very kind help!!!
Red2