WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

COMCONTROL
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Dialog Grid Example Using TrueDBGrid COM Object


Question:

Does anyone have a recommendation for a GridControl that you "know" works well with WB and the new comevent option. I don't mind paying if needed. As a minimum I would like to be able to bind to a datasource if possible or at least be able to load several hundred (to a couple of thousand) rows in a very short time period(I realize this is realitive), sort by clicking the column header, easily determine the selected row(s) and retrieve the data, etc.

I have worked with the MSFlexGrid control as well as a couple of others but haven't quite found what I need.

Answer:

The following code creates all of the events and "variablizes" all the constants, as well as included code for sorting when clicking on a column header.

This, of course, will not work or be useful if you don't have the TrueDBGrid control installed but will be a nice start if you try it out. http://componentsource.com/products/510700/16857/index.html

I'm sure you will need to tweak the database connection info as well.

Jim Taylor

GoSub Load_Routines
Init_Dialog_Constants()
db_file = StrCat("your database file") ;MODIFY TO FIT YOUR NEEDS

TGRIDFormat=`WWWDLGED,6.1`
TGRIDCaption=`DataGrid`
TGRIDX=-01
TGRIDY=-01
TGRIDWidth=472
TGRIDHeight=227
TGRIDNumControls=002
TGRIDProcedure=`TGrid_Sub`
TGRIDFont=`DEFAULT`
TGRIDTextColor=`DEFAULT`
TGRIDBackground=`DEFAULT,DEFAULT`
TGRIDConfig=0
TGRID001=`425,209,036,012,PUSHBUTTON,DEFAULT,"E&xit",99,2,32,DEFAULT,DEFAULT,DEFAULT`
TGRID002=`003,003,462,182,COMCONTROL,DEFAULT,"TrueOleDBGrid80.TDBGrid",DEFAULT,8,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
ButtonPushed=Dialog("TGRID")

:LOAD_ROUTINES
#DefineFunction RGB(r, g, b)
   Return r|(g<<8)|(b<<16)
#EndFunction

#DefineSubRoutine TGrid_Init_Variables()
  pb_TGR_Exit                              = 1
  co_TGR_grid                              = 2
#EndSubRoutine

#DefineSubRoutine Init_Grid()
    grid.AllowUpdate = @FALSE
;   grid.BackColor=RGB(0,0,255)
#EndSubRoutine

#DefineSubRoutine Get_HeadClick(col_num)
;       col_num = DEInfo.Parameters(1).Value
        gname = grid.Columns(col_num).DataField
        gtext = grid.Columns(col_num).Text
        Message(DEInfo,StrCat("g_HeadClick",@CRLF,col_num,@CRLF,grid.Columns.Count,@CRLF,gname,@CRLF,gtext))
        If IsDefined(%gname%_sort_ord) Then
          If %gname%_sort_ord == "ASC"  Then
            %gname%_sort_ord = "DESC"
            myREC.Sort = "%gname% DESC"
          Else
            %gname%_sort_ord = "ASC"
            myREC.Sort = "%gname% ASC"
          EndIf
        Else
          myREC.Sort = "%gname% ASC"
          %gname%_sort_ord = "ASC"
        EndIf
#EndSubRoutine

#DefineSubRoutine TGrid_Sub(TGR_Handle,DMsg,DCID,DEInfo,resvd5)
Switch (DMsg)
    Case msg_init                 ; Dialog Initialization
    DialogProcOptions(TGR_Handle, msg_timer,0)                            ; TimerEvent (0- Off).
    DialogProcOptions(TGR_Handle, msg_closevia49,-1)                      ; Close selected (IntControl(49....) (1-On, 0-Off).
    DialogProcOptions(TGR_Handle, dpo_disablestate,0)                     ; Dialog Disable (1-Disable, 2-Wait cursor, 0-Enable).
    DialogProcOptions(TGR_Handle, dpo_changebackground,-1)                ; Change Dialog Background (Bitmap File or RGB String).
    DialogProcOptions(TGR_Handle, msg_buttonpushed,1)                     ; PushButton/PictureButton.
;   DialogProcOptions(TGR_Handle, msg_comevent,1)                         ; ComEvent
    TGrid_Init_Variables()
    ;############################
    ; Establish the connection
    ;############################
    myConn = ObjectOpen('ADODB.Connection')
    myREC = ObjectOpen('ADODB.Recordset')
    myREC.CursorLocation = 3
    myConn.Provider = "ASAProv"
    myConn.ConnectionString = "Provider=ASAProv; DBF=%db_file%; Userid=xxx; Password=xxxxxxxxx"
    myConn.Open
    beg_chk = "Y"

    SQLText = StrCat("Select * from resources")
    myREC.Open (SQLText, myConn, adOpenDynamic, adLockBatchOptimistic, adCmdText)
    grid = DialogObject(TGR_Handle,co_TGR_grid,dlgobject_getobject)
    grid.DataSource = myREC
;   DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"HeadClick",g_HeadClick)
    objecteventadd(grid,"HeadClick","Get_HeadClick")
;   Init_Events()
    Init_Grid()
    Break
  Case msg_timer                ; TimerEvent
    Break
  Case msg_closevia49           ; Close
    Break
  Case msg_comevent             ; ComEvent
    Switch(DEInfo.Identifier)
;     Case g_AfterColEdit
;       Message(DEInfo,"g_AfterColEdit")
;     Break
;     Case g_AfterColUpdate
;       Message(DEInfo,"g_AfterColUpdate")
;     Break
;     Case g_AfterDelete
;       Message(DEInfo,"g_AfterDelete")
;     Break
;     Case g_AfterInsert
;       Message(DEInfo,"g_AfterInsert")
;     Break
;     Case g_AfterUpdate
;       Message(DEInfo,"g_AfterUpdate")
;     Break
;     Case g_BeforeColEdit
;       Message(DEInfo,"g_BeforeColEdit")
;     Break
;     Case g_BeforeColUpdate
;       Message(DEInfo,"g_BeforeColUpdate")
;     Break
;     Case g_BeforeDelete
;       Message(DEInfo,"g_BeforeDelete")
;     Break
;     Case g_BeforeInsert
;       Message(DEInfo,"g_BeforeInsert")
;     Break
;     Case g_BeforeOpen
;       Message(DEInfo,"g_BeforeOpen")
;     Break
;     Case g_BeforeRowColChange
;       Message(DEInfo,"g_BeforeRowColChange")
;     Break
;     Case g_BeforeUpdate
;       Message(DEInfo,"g_BeforeUpdate")
;     Break
;     Case g_ButtonClick
;       Message(DEInfo,"g_ButtonClick")
;     Break
;     Case g_Change
;       Message(DEInfo,"g_Change")
;     Break
;     Case g_ClassicAdd
;       Message(DEInfo,"g_ClassicAdd")
;     Break
;     Case g_ClassicDelete
;       Message(DEInfo,"g_ClassicDelete")
;     Break
;     Case g_ClassicRead
;       Message(DEInfo,"g_ClassicRead")
;     Break
;     Case g_ClassicWrite
;       Message(DEInfo,"g_ClassicWrite")
;     Break
;     Case g_Click
;       Message(DEInfo,"g_Click")
;     Break
;     Case g_ColEdit
;       Message(DEInfo,"g_ColEdit")
;     Break
;     Case g_Collapse
;       Message(DEInfo,"g_Collapse")
;     Break
;     Case g_ColMove
;       Message(DEInfo,"g_ColMove")
;     Break
;     Case g_ColResize
;       Message(DEInfo,"g_ColResize")
;     Break
;     Case g_ComboSelect
;       Message(DEInfo,"g_ComboSelect")
;     Break
;     Case g_DataSourceChanged
;       Message(DEInfo,"g_DataSourceChanged")
;     Break
;     Case g_DblClick
;       Message(DEInfo,"g_DblClick")
;     Break
;     Case g_DragCell
;       Message(DEInfo,"g_DragCell")
;     Break
;     Case g_Error
;       Message(DEInfo,"g_Error")
;     Break
;     Case g_Expand
;       Message(DEInfo,"g_Expand")
;     Break
;     Case g_FetchCellStyle
;       Message(DEInfo,"g_FetchCellStyle")
;     Break
;     Case g_FetchCellTips
;       Message(DEInfo,"g_FetchCellTips")
;     Break
;     Case g_FetchRowStyle
;       Message(DEInfo,"g_FetchRowStyle")
;     Break
;     Case g_FetchScrollTips
;       Message(DEInfo,"g_FetchScrollTips")
;     Break
;     Case g_FilterButtonClick
;       Message(DEInfo,"g_FilterButtonClick")
;     Break
;     Case g_FilterChange
;       Message(DEInfo,"g_FilterChange")
;     Break
;     Case g_FirstRowChange
;       Message(DEInfo,"g_FirstRowChange")
;     Break
;     Case g_FootClick
;       Message(DEInfo,"g_FootClick")
;     Break
;     Case g_FormatText
;       Message(DEInfo,"g_FormatText")
;     Break
;     Case g_GroupColMove
;       Message(DEInfo,"g_GroupColMove")
;     Break
;     Case g_GroupHeadClick
;       Message(DEInfo,"g_GroupHeadClick")
;     Break
      Case g_HeadClick
        col_num = DEInfo.Parameters(1).Value
        gname = grid.Columns(col_num).DataField
        gtext = grid.Columns(col_num).Text
        Message(DEInfo,StrCat("g_HeadClick",@CRLF,col_num,@CRLF,grid.Columns.Count,@CRLF,gname,@CRLF,gtext))
        If IsDefined(%gname%_sort_ord) Then
          If %gname%_sort_ord == "ASC"  Then
            %gname%_sort_ord = "DESC"
            myREC.Sort = "%gname% DESC"
          Else
            %gname%_sort_ord = "ASC"
            myREC.Sort = "%gname% ASC"
          EndIf
        Else
          myREC.Sort = "%gname% ASC"
          %gname%_sort_ord = "ASC"
        EndIf
      Break
;     Case g_KeyDown
;       Message(DEInfo,"g_KeyDown")
;     Break
;     Case g_KeyPress
;       Message(DEInfo,"g_KeyPress")
;     Break
;     Case g_KeyUp
;       Message(DEInfo,"g_KeyUp")
;     Break
;     Case g_LayoutReady
;       Message(DEInfo,"g_LayoutReady")
;     Break
;     Case g_LeftColChange
;       Message(DEInfo,"g_LeftColChange")
;     Break
;     Case g_MouseDown
;       Message(DEInfo,"g_MouseDown")
;     Break
;     Case g_MouseMove
;       Message(DEInfo,"g_MouseMove")
;     Break
;     Case g_MouseUp
;       Message(DEInfo,"g_MouseUp")
;     Break
;     Case g_OLECompleteDrag
;       Message(DEInfo,"g_OLECompleteDrag")
;     Break
;     Case g_OLEDragDrop
;       Message(DEInfo,"g_OLEDragDrop")
;     Break
;     Case g_OLEDragOver
;       Message(DEInfo,"g_OLEDragOver")
;     Break
;     Case g_OLEGiveFeedback
;       Message(DEInfo,"g_OLEGiveFeedback")
;     Break
;     Case g_OLESetData
;       Message(DEInfo,"g_OLESetData")
;     Break
;     Case g_OLEStartDrag
;       Message(DEInfo,"g_OLEStartDrag")
;     Break
;     Case g_OnAddNew
;       Message(DEInfo,"g_OnAddNew")
;     Break
;     Case g_OnInit
;       Message(DEInfo,"g_OnInit")
;     Break
;     Case g_OwnerDrawCell
;       Message(DEInfo,"g_OwnerDrawCell")
;     Break
;     Case g_OwnerDrawCellPrint
;       Message(DEInfo,"g_OwnerDrawCellPrint")
;     Break
;     Case g_OwnerDrawPageFooter
;       Message(DEInfo,"g_OwnerDrawPageFooter")
;     Break
;     Case g_OwnerDrawPageHeader
;       Message(DEInfo,"g_OwnerDrawPageHeader")
;     Break
;     Case g_Paint
;       Message(DEInfo,"g_Paint")
;     Break
;     Case g_PostEvent
;       Message(DEInfo,"g_PostEvent")
;     Break
;     Case g_RowColChange
;       Message(DEInfo,"g_RowColChange")
;     Break
;     Case g_RowResize
;       Message(DEInfo,"g_RowResize")
;     Break
;     Case g_Scroll
;       Message(DEInfo,"g_Scroll")
;     Break
;     Case g_SelChange
;       Message(DEInfo,"g_SelChange")
;     Break
;     Case g_SplitChange
;       Message(DEInfo,"g_SplitChange")
;     Break
;     Case g_UnboundAddData
;       Message(DEInfo,"g_UnboundAddData")
;     Break
;     Case g_UnboundColumnFetch
;       Message(DEInfo,"g_UnboundColumnFetch")
;     Break
;     Case g_UnboundDeleteRow
;       Message(DEInfo,"g_UnboundDeleteRow")
;     Break
;     Case g_UnboundGetRelativeBookmark
;       Message(DEInfo,"g_UnboundGetRelativeBookmark")
;     Break
;     Case g_UnboundReadData
;       Message(DEInfo,"g_UnboundReadData")
;     Break
;     Case g_UnboundReadDataEx
;       Message(DEInfo,"g_UnboundReadDataEx")
;     Break
;     Case g_UnboundWriteData
;       Message(DEInfo,"g_UnboundWriteData")
;     Break
;     Case g_ValueItemError
;       Message(DEInfo,"g_ValueItemError")
;     Break
    EndSwitch
    Break
  Case msg_buttonpushed         ; PushButtion
    Switch(DCID)
      Case pb_TGR_Exit
        nSelection = DialogControlGet(TGR_Handle,pb_TGR_Exit,dc_title)
        Exit
        Break
    EndSwitch
    Break
EndSwitch
Return -2
#EndSubRoutine

#DefineSubRoutine Init_Events()
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"AfterColEdit",g_AfterColEdit)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"AfterColUpdate",g_AfterColUpdate)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"AfterDelete",g_AfterDelete)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"AfterInsert",g_AfterInsert)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"AfterUpdate",g_AfterUpdate)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"BeforeColEdit",g_BeforeColEdit)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"BeforeColUpdate",g_BeforeColUpdate)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"BeforeDelete",g_BeforeDelete)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"BeforeInsert",g_BeforeInsert)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"BeforeOpen",g_BeforeOpen)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"BeforeRowColChange",g_BeforeRowColChange)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"BeforeUpdate",g_BeforeUpdate)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"ButtonClick",g_ButtonClick)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"Change",g_Change)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"ClassicAdd",g_ClassicAdd)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"ClassicDelete",g_ClassicDelete)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"ClassicRead",g_ClassicRead)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"ClassicWrite",g_ClassicWrite)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"Click",g_Click)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"ColEdit",g_ColEdit)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"Collapse",g_Collapse)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"ColMove",g_ColMove)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"ColResize",g_ColResize)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"ComboSelect",g_ComboSelect)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"DataSourceChanged",g_DataSourceChanged)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"DblClick",g_DblClick)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"DragCell",g_DragCell)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"Error",g_Error)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"Expand",g_Expand)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"FetchCellStyle",g_FetchCellStyle)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"FetchCellTips",g_FetchCellTips)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"FetchRowStyle",g_FetchRowStyle)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"FetchScrollTips",g_FetchScrollTips)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"FilterButtonClick",g_FilterButtonClick)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"FilterChange",g_FilterChange)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"FirstRowChange",g_FirstRowChange)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"FootClick",g_FootClick)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"FormatText",g_FormatText)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"GroupColMove",g_GroupColMove)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"GroupHeadClick",g_GroupHeadClick)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"HeadClick",g_HeadClick)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"KeyDown",g_KeyDown)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"KeyPress",g_KeyPress)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"KeyUp",g_KeyUp)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"LayoutReady",g_LayoutReady)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"LeftColChange",g_LeftColChange)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"MouseDown",g_MouseDown)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"MouseMove",g_MouseMove)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"MouseUp",g_MouseUp)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"OLECompleteDrag",g_OLECompleteDrag)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"OLEDragDrop",g_OLEDragDrop)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"OLEDragOver",g_OLEDragOver)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"OLEGiveFeedback",g_OLEGiveFeedback)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"OLESetData",g_OLESetData)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"OLEStartDrag",g_OLEStartDrag)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"OnAddNew",g_OnAddNew)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"OnInit",g_OnInit)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"OwnerDrawCell",g_OwnerDrawCell)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"OwnerDrawCellPrint",g_OwnerDrawCellPrint)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"OwnerDrawPageFooter",g_OwnerDrawPageFooter)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"OwnerDrawPageHeader",g_OwnerDrawPageHeader)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"Paint",g_Paint)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"PostEvent",g_PostEvent)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"RowColChange",g_RowColChange)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"RowResize",g_RowResize)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"Scroll",g_Scroll)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"SelChange",g_SelChange)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"SplitChange",g_SplitChange)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"UnboundAddData",g_UnboundAddData)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"UnboundColumnFetch",g_UnboundColumnFetch)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"UnboundDeleteRow",g_UnboundDeleteRow)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"UnboundGetRelativeBookmark",g_UnboundGetRelativeBookmark)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"UnboundReadData",g_UnboundReadData)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"UnboundReadDataEx",g_UnboundReadDataEx)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"UnboundWriteData",g_UnboundWriteData)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_addevent,"ValueItemError",g_ValueItemError)
  Return
#EndSubRoutine

#DefineSubRoutine Remove_Events()
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"AfterColEdit",g_AfterColEdit)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"AfterColUpdate",g_AfterColUpdate)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"AfterDelete",g_AfterDelete)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"AfterInsert",g_AfterInsert)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"AfterUpdate",g_AfterUpdate)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"BeforeColEdit",g_BeforeColEdit)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"BeforeColUpdate",g_BeforeColUpdate)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"BeforeDelete",g_BeforeDelete)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"BeforeInsert",g_BeforeInsert)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"BeforeOpen",g_BeforeOpen)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"BeforeRowColChange",g_BeforeRowColChange)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"BeforeUpdate",g_BeforeUpdate)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"ButtonClick",g_ButtonClick)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"Change",g_Change)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"ClassicAdd",g_ClassicAdd)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"ClassicDelete",g_ClassicDelete)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"ClassicRead",g_ClassicRead)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"ClassicWrite",g_ClassicWrite)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"Click",g_Click)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"ColEdit",g_ColEdit)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"Collapse",g_Collapse)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"ColMove",g_ColMove)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"ColResize",g_ColResize)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"ComboSelect",g_ComboSelect)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"DataSourceChanged",g_DataSourceChanged)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"DblClick",g_DblClick)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"DragCell",g_DragCell)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"Error",g_Error)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"Expand",g_Expand)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"FetchCellStyle",g_FetchCellStyle)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"FetchCellTips",g_FetchCellTips)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"FetchRowStyle",g_FetchRowStyle)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"FetchScrollTips",g_FetchScrollTips)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"FilterButtonClick",g_FilterButtonClick)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"FilterChange",g_FilterChange)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"FirstRowChange",g_FirstRowChange)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"FootClick",g_FootClick)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"FormatText",g_FormatText)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"GroupColMove",g_GroupColMove)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"GroupHeadClick",g_GroupHeadClick)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"HeadClick",g_HeadClick)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"KeyDown",g_KeyDown)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"KeyPress",g_KeyPress)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"KeyUp",g_KeyUp)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"LayoutReady",g_LayoutReady)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"LeftColChange",g_LeftColChange)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"MouseDown",g_MouseDown)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"MouseMove",g_MouseMove)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"MouseUp",g_MouseUp)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"OLECompleteDrag",g_OLECompleteDrag)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"OLEDragDrop",g_OLEDragDrop)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"OLEDragOver",g_OLEDragOver)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"OLEGiveFeedback",g_OLEGiveFeedback)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"OLESetData",g_OLESetData)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"OLEStartDrag",g_OLEStartDrag)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"OnAddNew",g_OnAddNew)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"OnInit",g_OnInit)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"OwnerDrawCell",g_OwnerDrawCell)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"OwnerDrawCellPrint",g_OwnerDrawCellPrint)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"OwnerDrawPageFooter",g_OwnerDrawPageFooter)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"OwnerDrawPageHeader",g_OwnerDrawPageHeader)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"Paint",g_Paint)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"PostEvent",g_PostEvent)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"RowColChange",g_RowColChange)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"RowResize",g_RowResize)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"Scroll",g_Scroll)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"SelChange",g_SelChange)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"SplitChange",g_SplitChange)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"UnboundAddData",g_UnboundAddData)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"UnboundColumnFetch",g_UnboundColumnFetch)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"UnboundDeleteRow",g_UnboundDeleteRow)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"UnboundGetRelativeBookmark",g_UnboundGetRelativeBookmark)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"UnboundReadData",g_UnboundReadData)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"UnboundReadDataEx",g_UnboundReadDataEx)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"UnboundWriteData",g_UnboundWriteData)
  DialogObject(TGR_Handle,co_TGR_grid,dlgobject_removeevent,"ValueItemError",g_ValueItemError)
  Return
#EndSubRoutine

#DefineSubRoutine Init_Dialog_Constants()
   ;DialogprocOptions Constants
   MSG_INIT               = 0    ; The one-time initilization
   MSG_TIMER              = 1    ; Timer event
   MSG_BUTTONPUSHED       = 2    ; Pushbutton or Picturebutton
   MSG_RADIOPUSHED        = 3    ; Radiobutton clicked
   MSG_CHECKBOX           = 4    ; Checkbox clicked
   MSG_EDITBOX            = 5    ; Editbox or Multilinebox
   MSG_FILESELECT         = 6    ; Filelistbox
   MSG_ITEMSELECT         = 7    ; Itembox
   MSG_COMBOCHANGE        = 8    ; Combobox/Droplistbox
   MSG_CALENDAR           = 9    ; Calendar date change
   MSG_SPINNER            = 10   ; Spinner number change
   MSG_CLOSEVIA49         = 11   ; Close clicked (Enabled via Intcontrol 49)
   MSG_FILEBOXDOUBLECLICK = 12   ; Get double-click message on a FileListBox
   MSG_ITEMBOXDOUBLECLICK = 13   ; Get double-click message on an ItemBox
   MSG_COMEVENT           = 14   ; COM Event
   DPO_DISABLESTATE       = 1000 ; codes -1=GetSetting 0=EnableDialog 1=DisableDialog
   DPO_CHANGEBACKGROUND   = 1001 ; -1=GetSetting otherise bitmap or color string
   DPO_CHANGESYSMENU      = 1002 ; -1=Get Current 0=none 1=close 2=close/min 3=close/max 4=close/min/max
   DPO_CHANGETITLE        = 1003 ; -1=Get Current otherise new title
   ;DialogControlState Constants
   DCSTATE_SETFOCUS       = 1    ; Give Control Focus
   DCSTATE_QUERYSTYLE     = 2    ; Query control's style
   DCSTATE_ADDSTYLE       = 3    ; Add control style
   DCSTATE_REMOVESTYLE    = 4    ; Remove control style
   DCSTATE_GETFOCUS       = 5    ; Get control that has focus
   DCSTYLE_INVISIBLE      = 1    ; Set Control Invisible
   DCSTYLE_DISABLED       = 2    ; Set Control Disabled
   DCSTYLE_NOUSERDATA     = 4    ; Note: Setable via DialogControlState function ONLY SPINNER control only
   DCSTYLE_READONLY       = 8    ; Sets control to read-only (user cannot type in data) EDITBOX MULTILINEBOX SPINNER
   DCSTYLE_PASSWORD       = 16   ; Sets 'password mode' where only *'s are displayed EDITBOX
   DCSTYLE_DEFAULTBUTTON  = 32   ; Sets a button as a the default button PUSHBUTTON PICTUREBUTTON
   DCSTYLE_DIGITSONLY     = 64   ; Set edit box to accept digits only EDITMOX MULTILINEBOX
   DCSTYLE_FLAT           = 128  ; Makes a 'flat' hyperlink-looking button PUSHBUTTON PICTUREBUTTON
   DCSTYLE_HEIGHT         = 256  ; Turns off automatic height adjustment on ItemBoxes and FileListBoxes
   DCSTYLE_CENTER         = 512  ; Center Text in VARYTEXT and STATICTEXT Controls
   DCSTYLE_RIGHT          = 1024 ; Right Justify Text in VARYTEXT and STATICTEXT Controls
   DCSTYLE_NOSELCURLEFT   = 2048 ; No selection, cursor left EDITBOX MULTILINEBOX
   DCSTYLE_NOSELCURRIGHT  = 4096 ; No selection, cursor right EDITBOX MULTILINEBOX
   ;DialogControlSet / DialogControlGet Constants
   DC_CHECKBOX            = 1    ; CHECKBOX
   DC_RADIOBUTTON         = 2    ; RADIOBUTTON
   DC_EDITBOX             = 3    ; EDITBOX MULTILINEBOX
   DC_TITLE               = 4    ; PICTURE RADIOBUTTON CHECKBOX PICTUREBUTTON VARYTEXT STATICTEXT GROUPBOX PUSHBUTTON
   DC_ITEMBOXCONTENTS     = 5    ; ITEMBOX FILELISTBOX DROPLISTBOX
   DC_ITEMBOXSELECT       = 6    ; ITEMBOX FILELISTBOX DROPLISTBOX
   DC_CALENDAR            = 7    ; CALENDAR
   DC_SPINNER             = 8    ; SPINNER
   DC_MULTITABSTOPS       = 9    ; MULTILINEBOX
   DC_ITEMSCROLLPOS       = 10   ; ITEMBOX FILELISTBOX
   DC_BACKGROUNDCOLOR     = 11   ; RADIOBUTTON CHECKBOX VARYTEXT STATICTEXT GROUPBOX PUSHBUTTON ITEMBOX FILELISTBOX DROPLISTBOX SPINNER EDITBOX MULTILINEBOX
   DC_PICTUREBITMAP       = 12   ; PICTURE PICTUREBUTTON
   DC_TEXTCOLOR           = 13   ; RADIOBUTTON CHECKBOX VARYTEXT STATICTEXT GROUPBOX PUSHBUTTON ITEMBOX FIELLISTBOX DROPLISTBOX SPINNER EDITBOX MULTILINEBOX
   DC_ITEMBOXADD          = 14   ; ITEMBOX FILELISTBOX DROPLISTBOX
   DC_ITEMBOXREMOVE       = 15   ; ITEMBOX FILELISTBOX DROPLISTBOX
   DC_RADIOCONTROL        = 16   ; RADIOBUTTON

   ;Return code constants
   RET_DO_CANCEL=0           ; Cancels dialog
   RET_DO_DEFAULT= -1        ; Continue with default processing for control
   RET_DO_NOT_EXIT= -2       ; Do not exit the dialog

   DLGOBJECT_ADDEVENT     = 1
   DLGOBJECT_REMOVEEVENT  = 2
   DLGOBJECT_GETOBJECT    = 3
   DLGOBJECT_GETPICOBJECT = 4

;########################################
;Grid Constants
;########################################
  ;AddNewMode Constants
  dbgNoAddNew                          = 0       ; No AddNew pending
  dbgAddNewCurrent                     = 1       ; Current cell in AddNew row
  dbgAddNewPending                     = 2       ; AddNew pending

  ;Alignment Constants

  dbgLeft                              = 0       ; Left
  dbgRight                             = 1       ; Right
  dbgCenter                            = 2       ; Center
  dbgGeneral                           = 3       ; General (default)

  ;AnimateWindow Constants

  dbgNoAnimate                         = 0       ; No Animate (default)
  dbgRoll                              = 1       ; Roll
  dbgSlide                             = 2       ; Slide
  dbgBlend                             = 3       ; Blend

  ;AnimateWindowClose Constants

  dbgNoAnimateClose                    = 0       ; No Animate Close (default)
  dbgOppositeDirection                 = 1       ; Opposite Direction
  dbgSameDirection                     = 2       ; Same Direction

  ;AnimateWindowDirection Constants

  dbgDefaultDirection                  = 0       ; Default
  dbgTopToBottom                       = 1       ; Top To Bottom
  dbgBottomToTop                       = 2       ; Bottom To Top
  dbgLeftToRight                       = 3       ; Left To Right
  dbgRightToLeft                       = 4       ; Right To Left
  dbgTopLeftToBottomRight              = 5       ; Top Left To Bottom Right
  dbgTopRightToBottomLeft              = 6       ; Top Right To Bottom Left
  dbgBottomLeftToTopRight              = 7       ; Bottom Left To Right
  dbgBottomRightToTopLeft              = 8       ; Bottom Right To Top Left
  dbgAnimateCenter                     = 9       ; Center

  ;Appearance Constants

  dbgFlat                              = 0       ; Flat
  dbg3D                                = 1       ; 3D (default)

  ;BackgroundPictureDrawMode Constants

  dbgBPCenter                          = 0       ; Center (default)
  dbgBPTile                            = 1       ; Tile
  dbgBPStretch                         = 2       ; Stretch

  ;BorderStyle Constants

  dbgNoBorder                          = 0       ; None
  dbgFixedSingle                       = 1       ; Fixed Single (default)

  ;CellStyle Constants

  dbgAllCells                          = -1       ; All Cells
  dbgNormalCell                        = 0       ; Cells without status conditions
  dbgCurrentCell                       = 1       ; Current cell
  dbgMarqueeRow                        = 2       ; Cells in a highlighted row
  dbgUpdatedCell                       = 4       ; Cells that have been modified
  dbgSelectedRow                       = 8       ; Cells in a selected row

  ;CellTip Constants

  dbgOnRecordSelector                  = -1       ; On Record Selector
  dbgOnEmptyColumn                     = -2       ; On Empty Column
  dbgOnColumnHeader                    = -1       ; On Column Header
  dbgOnSplitHeader                     = -2       ; On Split Header
  dbgOnEmptyRow                        = -3       ; On Empty Row
  dbgOnCaption                         = -4       ; On Caption
  dbgOnAddNew                          = -5       ; On AddNew Row
  dbgOnColumnFooter                    = -6       ; On Column Footer

  ;CellTipPresentation Constants

  dbgNoCellTips                        = 0       ; None (default)
  dbgAnchored                          = 1       ; Anchored
  dbgFloating                          = 2       ; Floating

  ;ConvertEmptyCell Constants

  dbgNoConversion                      = 0       ; Write as is (default)
  dbgAsNull                            = 1       ; Write as Null value

  ;DataMode Constants

  dbgBound                             = 0       ; Bound (default)
  dbgUnbound                           = 1       ; Unbound
  dbgUnboundEx                         = 2       ; Unbound Extended
  dbgUnboundAp                         = 3       ; Application
  dbgUnboundSt                         = 4       ; Storage

  ;DataView Constants

  dbgNormalView                        = 0       ; Normal (default)
  dbgHierarchicalView                  = 1       ; Hierarchical
  dbgGroupView                         = 2       ; Group

  ;DividerStyle Constants

  dbgNoDividers                        = 0       ; No dividers (Split default)
  dbgBlackLine                         = 1       ; Black line
  dbgDarkGrayLine                      = 2       ; Dark gray line (non-Split default)
  dbgRaised                            = 3       ; Raised
  dbgInset                             = 4       ; Inset
  dbgUseForeColor                      = 5       ; ForeColor
  dbgLightGrayLine                     = 6       ; Light gray line
  dbgCustomColor                       = 7       ; Custom color
  dbgDoubleLine                        = 8       ; Double line

  ;Error Constants

  dbgBINDERROR                         = 4097       ; Cannot initialize data bindings
  dbgINVPROPVAL                        = 4098       ; Invalid setting for name property
  dbgCOLINDEX                          = 6145       ; Invalid column index
  dbgNOTINIT                           = 6146       ; Control not properly initialized
  dbgCNOTFOUND                         = 6147       ; Column not found
  dbgINVROWNUM                         = 6148       ; Invalid row number
  dbgINVBOOKMARK                       = 6149       ; Invalid bookmark
  dbgBADSELRIDX                        = 6150       ; Invalid selected row bookmark index
  dbgSCROLLRANGE                       = 6151       ; Scroll arguments out of range
  dbgINVSBSTYLE                        = 6152       ; Invalid setting for ScrollBars property
  dbgUPDERROR                          = 6153       ; Error occurred while trying to update record
  dbgADDERROR                          = 6154       ; Error occurred while trying to add record
  dbgDELERROR                          = 6155       ; Error occurred while trying to delete record
  dbgCOLDATA                           = 6156       ; Data type mismatch during field update
  dbgINCOMPAT                          = 6157       ; Data type incompatible with column data type
  dbgFIELDERR                          = 6158       ; name is not a valid data field name
  dbgDELMULTROWS                       = 6159       ; Cannot delete multiple rows
  dbgDATAACCESS                        = 6160       ; Data access error
  dbgBADEVENT                          = 6161       ; Operation is invalid within the event name
  dbgNOPROPNOW                         = 6162       ; Property is not available in this context
  dbgNOCURREC                          = 6163       ; No current record
  dbgCAPTOOLONG                        = 6164       ; Caption text is too long
  dbgSPLITINDEX                        = 6244       ; Invalid split index
  dbgVLINDEX                           = 6245       ; Invalid value list index
  dbgVITEMERR                          = 6246       ; Error accessing value item
  dbgSTYLEINDEX                        = 6247       ; Invalid style index
  dbgDUPSTYLE                          = 6248       ; Duplicate style name
  dbgSTYLEERR                          = 6249       ; Error accessing style
  dbgUPDSTYLE                          = 6250       ; Error updating style
  dbgREMSTYLE                          = 6251       ; Error removing style
  dbgADDCELLCOND                       = 6252       ; Error adding cell condition
  dbgSTYLENAME                         = 6253       ; Invalid style name
  dbgAPPLYSTYLE                        = 6254       ; Error applying style
  dbgBMPTOOLARGE                       = 6255       ; Bitmap is too large

  ;ExposeCellMode Constants

  dbgScrollOnSelect                    = 0       ; Scroll on Select (default)
  dbgScrollOnEdit                      = 1       ; Scroll on Edit
  dbgScrollNever                       = 2       ; Never Scroll

  ;FetchCellStyle Constants

  dbgFetchCellStyleNone                = 0       ; None
  dbgFetchCellStyleColumn              = 1       ; Column
  dbgFetchCellStyleAddNewColumn        = 2       ; Column and AddNew

  ;ForegroundPicturePosition Constants

  dbgFPLeft                            = 0       ; Left (default)
  dbgFPRight                           = 1       ; Right
  dbgFPLeftOfText                      = 2       ; Left of Text
  dbgFPRightOfText                     = 3       ; Right of Text
  dbgFPTopOfText                       = 4       ; Top of Text
  dbgFPBottomOfText                    = 5       ; Bottom of Text
  dbgFPPictureOnly                     = 6       ; Picture Only
  dbgFPTextOnly                        = 7       ; Text Only

  ;MarqueeStyle Constants

  dbgDottedCellBorder                  = 0       ; Dotted Cell Border
  dbgSolidCellBorder                   = 1       ; Solid Cell Border
  dbgHighlightCell                     = 2       ; Highlight Cell
  dbgHighlightRow                      = 3       ; Highlight Row
  dbgHighlightRowRaiseCell                          = 4       ; Highlight Row, Raise Cell
  dbgNoMarquee                         = 5       ; No Marquee
  dbgFloatingEditor                    = 6       ; Floating Editor (default)
  dbgDottedRowBorder                   = 7       ; Dotted Row Border

  ;MergeCell Constants

  dbgMergeNone                         = 0       ; None
  dbgMergeFree                         = 1       ; Free
  dbgMergeRestricted                   = 2       ; Restricted

  ;MousePointer Constants

  dbgMPDefault                         = 0       ; Default (default)
  dbgMPArrow                           = 1       ; Arrow
  dbgMPCross                           = 2       ; Cross
  dbgMPIbeam                           = 3       ; I-beam
  dbgMPIcon                            = 4       ; Icon
  dbgMPSize                            = 5       ; Size
  dbgMPSizeNESW                        = 6       ; Size NE SW
  dbgMPSizeNS                          = 7       ; Size NS
  dbgMPSizeNWSE                        = 8       ; Size NW SE
  dbgMPSizeEW                          = 9       ; Size EW
  dbgMPUpArrow                         = 10       ; Up Arrow
  dbgMPHourglass                       = 11       ; Hourglass
  dbgMPNoDrop                          = 12       ; No Drop
  dbgMPArrowHourglass                  = 13       ; Arrow Hourglass
  dbgMPArrowQuestion                   = 14       ; Arrow Question
  dbgMPSizeAll                         = 15       ; Size All
  dbgMPCustom                          = 99       ; Custom

  ;MoveDirection Constants

  dbgMoveNone                          = 0       ; None
  dbgMoveRight                         = 1       ; Right (default)
  dbgMoveDown                          = 2       ; Down
  dbgMoveLeft                          = 3       ; Left
  dbgMoveUp                            = 4       ; Up

  ;MultipleLines Constants

  dbgMultipleDisabled                  = 0       ; Disabled (default)
  dbgMultipleVariable                  = 1       ; Variable
  dbgMultipleFixed                     = 2       ; Fixed

  ;MultiSelect Constants

  dbgMultiSelectNone                   = 0       ; None
  dbgMultiSelectSimple                 = 1       ; Simple (default)
  dbgMultiSelectExtended               = 2       ; Extended

  ;OLEDragMode Constants

  dbgOLEDragManual                     = 0       ; Manual (default)
  dbgOLEDragAutomatic                  = 1       ; Automatic

  ;OLEDropMode Constants

  dbgOLEDropNone                       = 0       ; None (default)
  dbgOLEDropManual                     = 1       ; Manual
  dbgOLEDropAutomatic                  = 2       ; Automatic

  ;PointAt Constants

  dbgNotInGrid                         = 0       ; Not in Grid
  dbgAtCaption                         = 1       ; At Grid Caption
  dbgAtSplitHeader                     = 2       ; At Split Header
  dbgAtSplitSizeBox                    = 3       ; At Split Size Box
  dbgAtRowSelect                       = 4       ; At Row Select
  dbgAtRowSize                         = 5       ; At Row Size
  dbgAtColumnHeader                    = 6       ; At Column Header
  dbgAtColumnFooter                    = 7       ; At Column Footer
  dbgAtColumnSize                      = 8       ; At Column Size
  dbgAtDataArea                        = 9       ; At Data Area
  dbgAtGroupArea                       = 10       ; At Group Area
  dbgAtGroupHeader                     = 11       ; At Group Header

  ;Presentation Constants

  dbgNormal                            = 0       ; Normal (default)
  dbgRadioButton                       = 1       ; Radio Button
  dbgComboBox                          = 2       ; Combo Box
  dbgSortedComboBox                    = 3       ; Sorted Combo Box
  dbgCheckBox                          = 4       ; Check Box

  ;PrintInfo_Menu Constants

  dbgpMenuFile                         = 0       ; File
  dbgpMenuPrint                        = 1       ; Print
  dbgpMenuExit                         = 2       ; Exit
  dbgpMenuView                         = 3       ; View
  dbgpMenuZoomIn                       = 4       ; Zoom In
  dbgpMenuZoomOut                      = 5       ; Zoom Out
  dbgpMenuFit                          = 6       ; Fit in Window
  dbgpMenuPgFirst                      = 7       ; First Page
  dbgpMenuPgPrev                       = 8       ; Previous Page
  dbgpMenuPgNext                       = 9       ; Next Page
  dbgpMenuPgLast                       = 10       ; Last Page
  dbgpMenuPrintSomePages               = 11       ; Print Some Pages
  dbgpMenuPrintCurrPage                = 12       ; Print Current Page
  dbgpDlgPagesCaption                  = 13       ; Print Some Pages dialog caption
  dbgpDlgPagesPrompt                   = 14       ; Print Some Pages dialog prompt
  dbgpDlgPagesOk                       = 15       ; Print Some Pages dialog OK button text
  dbgpDlgPagesCancel                   = 16       ; Print Some Pages Cancel button text
  dbgpTipPrint                         = 17       ; Print Document
  dbgpTipZoomIn                        = 18       ; Zoom In
  dbgpTipZoomOut                       = 19       ; Zoom Out
  dbgpTipFit                           = 20       ; Fit in Window
  dbgpTipZoom                          = 21       ; Zoom Factor
  dbgpTipPgFirst                       = 22       ; Go to First Page
  dbgpTipPgPrev                        = 23       ; Go to Previous Page
  dbgpTipPgNext                        = 24       ; Go to Next Page
  dbgpTipPgLast                        = 25       ; Go to Last Page
  dbgpTipPageOf                        = 26       ; Current page number
  dbgpTipStop                          = 27       ; Stop Pagination
  dbgpMenuOpen                         = 28       ; Opens the Menu
  dbgpMenuSaveAs                       = 29       ; Save File As
  dbgpMenuPageSetup                    = 30       ; Page Setup
  dbgpTipOpen                          = 31       ; Open a Previously Saved Report
  dbgpTipSaveAs                        = 32       ; Save Current Report in a file
  dbgpTipPageSetup                     = 33       ; Show Page Setup Dialog
  dbgpFilemaskArx                      = 34       ; ComponentOne Report Files
  dbgpFilemaskAll                      = 35       ; All Files
  dbgpErrFileOpen                      = 36       ; Error Loading File
  dbgpErrFileSave                      = 37       ; Error Saving File
  dbgpErrFileFormat                    = 38       ; Not a Valid ComponentOne Report File
  dbgpApsCaption                       = 39       ; Adjust Page Settings
  dbgpApsText                          = 40       ; Contents Bigger Than Printable Area
  dbgpApsMargins                       = 41       ; Use Margins to Maximize Printable Area
  dbgpApsOrientation                   = 42       ; Select Best Orientation
  dbgpApsHorzText                      = 43       ; Horizontal Positioning of Printable Area
  dbgpApsHorzLeft                      = 44       ; Align to Left Margin
  dbgpApsHorzCenter                    = 45       ; Center Between Left and Right Margins
  dbgpApsHorzRight                     = 46       ; Align to Right Margin
  dbgpApsVerText                       = 47       ; Vertical Positioning of Printable Area
  dbgpApsVerTop                        = 48       ; Align to Top Margin
  dbgpApsVertCenter                    = 49       ; Center Between Top & Bottom Margins
  dbgpApsVertBottom                    = 50       ; Align to Bottom Margin
  dbgpApsPageSetup                     = 51       ; Page Setup
  dbgpMenuFileClose                    = 52       ; Close File Menu
  dbgpDlgExporting                     = 53       ; Preparing for Export
  dbgpDlgExportPage                    = 54       ; Exporting Page To
  dbgpTipFitWidth                      = 55       ; Fit Width
  dbgpTipActualSize                    = 56       ; Actual Size
  dbgpMenuFitWidth                     = 57       ; Fit Width
  dbgpMenuActualSize                   = 58       ; Actual Size
  dbgpTipRefresh                       = 59       ; Use to localize the Refresh button of the print preview window

  ;Notes
  ;All constants with Menu are menu items.
  ;All constants with Tip are tool tips.
  ;All constants with Aps are strings from the “adjust page settings” dialog (see below).
  ;All constants with Err are error messages.
  ;With the exception of 40 - dbgpApsText, all constants with Aps appear as part of a custom dialog available after the page settings have been changed and the preview must determine how to show the already generated pages.
  ;With 40 - dbgpApsText, a dialog appears: “The contents is bigger than the printable area of the page.  Please review and/or change options below and click OK to adjust the page settings and scale down the contents.”

  ;RowSelector Constants

  dbgAllRows                           = 0       ; All Rows
  dbgSelectedRows                      = 1       ; Selected Rows
  dbgCurrentRow                        = 2       ; Current Row

  ;ScrollBars Constants

  dbgNone                              = 0       ; None
  dbgHorizontal                        = 1       ; Horizontal
  dbgVertical                          = 2       ; Vertical
  dbgBoth                              = 3       ; Both
  dbgAutomatic                         = 4       ; Automatic (default)

  ;SplitSizeMode Constants

  dbgScalable                          = 0       ; Scalable (default)
  dbgExact                             = 1       ; Exact
  dbgNumberOfColumns                   = 2       ; Number of Columns

  ;StyleBorderAppearance Constants

  dbgFlatStyle                         = 0       ; Flat (default)
  dbg3DRaised                          = 1       ; Raised
  dbg3DInset                           = 2       ; Inset
  dbg3DRaiseBevel                      = 3       ; Raise Bevel
  dbg3DInsetBevel                      = 4       ; Inset Bevel

  ;StyleBorderType Constants

  dbgBorderNone                        = 0       ; None (default)
  dbgBorderLeft                        = 1       ; Left
  dbgBorderRight                       = 2       ; Right
  dbgBorderTop                         = 4       ; Top
  dbgBorderBottom                      = 8       ; Bottom

  ;TabAction Constants

  dbgControlNavigation                 = 0       ; Control Navigation (default)
  dbgColumnNavigation                  = 1       ; Column Navigation
  dbgGridNavigation                    = 2       ; Grid Navigation
  dbgGridColumnNavigation              = 3       ; Grid Column Navigation

  ;UnboundFind Constants

  dbgSeekLT                            = -1       ; Less Than
  dbgSeekLE                            = -2       ; Less Than or Equal
  dbgSeekEQ                            = -3       ; Equal
  dbgSeekGE                            = -4       ; Greater Than or Equal
  dbgSeekGT                            = -5       ; Greater Than
  dbgSeekPartialEQ                     = -6       ; Partially Equal

  ;VerticalAlignment Constants

  dbgTop                               = 0       ; Top (default)
  dbgBottom                            = 1       ; Bottom
  dbgVertCenter                        = 2       ; Vertical Center

;########################################
;Grid Events
;########################################
  g_AfterColEdit                = 1000
  g_AfterColUpdate              = 1001
  g_AfterDelete                 = 1002
  g_AfterInsert                 = 1003
  g_AfterUpdate                 = 1004
  g_BeforeColEdit               = 1005
  g_BeforeColUpdate             = 1006
  g_BeforeDelete                = 1007
  g_BeforeInsert                = 1008
  g_BeforeOpen                  = 1009
  g_BeforeRowColChange          = 1010
  g_BeforeUpdate                = 1011
  g_ButtonClick                 = 1012
  g_Change                      = 1013
  g_ClassicAdd                  = 1014
  g_ClassicDelete               = 1015
  g_ClassicRead                 = 1016
  g_ClassicWrite                = 1017
  g_Click                       = 1018
  g_ColEdit                     = 1019
  g_Collapse                    = 1020
  g_ColMove                     = 1021
  g_ColResize                   = 1022
  g_ComboSelect                 = 1023
  g_DataSourceChanged           = 1024
  g_DblClick                    = 1025
  g_DragCell                    = 1026
  g_Error                       = 1027
  g_Expand                      = 1028
  g_FetchCellStyle              = 1029
  g_FetchCellTips               = 1030
  g_FetchRowStyle               = 1031
  g_FetchScrollTips             = 1032
  g_FilterButtonClick           = 1033
  g_FilterChange                = 1034
  g_FirstRowChange              = 1035
  g_FootClick                   = 1036
  g_FormatText                  = 1037
  g_GroupColMove                = 1038
  g_GroupHeadClick              = 1039
  g_HeadClick                   = 1040
  g_KeyDown                     = 1041
  g_KeyPress                    = 1042
  g_KeyUp                       = 1043
  g_LayoutReady                 = 1044
  g_LeftColChange               = 1045
  g_MouseDown                   = 1046
  g_MouseMove                   = 1047
  g_MouseUp                     = 1048
  g_OLECompleteDrag             = 1049
  g_OLEDragDrop                 = 1050
  g_OLEDragOver                 = 1051
  g_OLEGiveFeedback             = 1052
  g_OLESetData                  = 1053
  g_OLEStartDrag                = 1054
  g_OnAddNew                    = 1055
  g_OnInit                      = 1056
  g_OwnerDrawCell               = 1057
  g_OwnerDrawCellPrint          = 1058
  g_OwnerDrawPageFooter         = 1059
  g_OwnerDrawPageHeader         = 1060
  g_Paint                       = 1061
  g_PostEvent                   = 1062
  g_RowColChange                = 1063
  g_RowResize                   = 1064
  g_Scroll                      = 1065
  g_SelChange                   = 1066
  g_SplitChange                 = 1067
  g_UnboundAddData              = 1068
  g_UnboundColumnFetch          = 1069
  g_UnboundDeleteRow            = 1070
  g_UnboundGetRelativeBookmark  = 1071
  g_UnboundReadData             = 1072
  g_UnboundReadDataEx           = 1073
  g_UnboundWriteData            = 1074
  g_ValueItemError              = 1075

;########################################
  ;ADO Constants
;########################################
  adOpenDynamic          = 2

  adOpenForwardOnly      = 0 ;Default. Uses a forward-only cursor.
  adOpenStatic           = 3 ;Uses a static cursor. A static copy used to find data or generate reports. Changes by other are not visible.
  adOpenKeySet           = 1 ;Uses a static cursor. A static copy used to find data or generate reports. Changes by other are not visible.
  adUseClient            = 3

  adLockReadOnly         = 1
  adLockOptimistic       = 3
  adCmdTableDirect       = 256

  adLockBatchOptimistic  = 4     ;Indicates optimistic batch updates. Required for batch update mode.
  adLockOptimistic       =  3    ;Indicates optimistic locking, record by record. The provider uses optimistic locking, locking records only when you call the Update method.
  adLockPessimistic      =  2    ; Indicates pessimistic locking, record by record. The provider does what is necessary to ensure successful editing of the records, usually by locking records at the data source immediately after editing.
  adLockReadOnly         =  1    ;Indicates read-only records. You cannot alter the data.
  adLockUnspecified      =  -1   ; Does not specify a type of lock. For clones, the clone is created with the same lock type as the original.

  adCmdUnspecified       = -1    ; Does not specify the command type argument.
  adCmdText              = 1     ; Evaluates CommandText as a textual definition of a command or stored procedure call.
  adCmdTable             = 2     ; Evaluates CommandText as a table name whose columns are all returned by an internally generated SQL query.
  adCmdStoredProc        = 4     ; Evaluates CommandText as a stored procedure name.
  adCmdUnknown           = 8     ; Default. Indicates that the type of command in the CommandText property is not known.
  adCmdFile              = 256   ; Evaluates CommandText as the file name of a persistently stored Recordset. Used with Recordset.Open or Requery only.
  adCmdTableDirect       = 512   ; Evaluates CommandText as a table name whose columns are all returned. Used with Recordset.Open or Requery only. To use the Seek method, the Recordset must be opened with adCmdTableDirect.
  Return
#EndSubRoutine

Return

Article ID:   W16928
File Created: 2007:07:03:14:27:06
Last Updated: 2007:07:03:14:27:06