Announcement

Collapse
No announcement yet.

Zeegrid - Any experience?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    I think I found my problem and fixed it.

    I had installed and turned on a High-Contrast theme ( in the hopes of being able to see the screen until I could get my eyes fixed ( cataracts ) ).
    Seems either the themes have minor glitches supporting all colors or the programs need to do extra checks to see if running under some of the
    High-Contrast themes.

    I reset the screen back to the default and the text is showing up. Yippee! Now on to actually trying the grid.

    Comment


    • #22
      Originally posted by jcfuller View Post
      Ok got it. Need to add this line:
      SendMessage hgrid, %ZGM_SETCOLUMNHEADERHEIGHT,10,0
      James
      Hi James, I contacted David about this issue; he fixed it and upload a new version of the DDL (same Build 37 but with a different released date).

      So there is no need to send the message %ZGM_SETCOLUMNHEADERHEIGHT to the grid
      Jean-Pierre LEROY

      Comment


      • #23
        Anyone else having a cell flashing problem?

        I have tried the many sample programs in this thread, I have gone through the tutorial and all programs suffer the same flickering. When you double click a cell it flashes 14 times in a row every half second or so and then skips 3 beats and then starts flashing again. Almost like a heartbeat refresh or something.

        Frank

        Comment


        • #24
          I am trying to get the highlighting to work on start-up using ZeeGrid. Once you click on the grid or use the arrows to move around it shows up. Just frustrating why I can't get it to start that way. I have posted Jean-Pierre's DDT code with the addition of the %WM_INITDIALOG section. Neither the GotoCell or SetCursorCell messages seem to work. They set the black box to frame the cell but not highlight the row.

          BTW, the flashing problem above was a bad video card/driver.

          Frank
          Code:
          #Compile Exe
          #Dim All
          #Include "WIN32API.INC"
          #Include "ZeeGrid.inc"
          
          Global hDlgMain As Long
          %IDC_ZeeGrid1 = 150
          
          CallBack Function SHOWhDlgMainProc()
          
            Local lIndex As Long
            Local lType  As Long
            Local lValue As Double
          
            Select Case Cb.Msg
              Case %WM_InitDialog
          
          
          ' trying to get the highlight to work on startup
          
                Control Send hDlgMain, %IDC_ZeeGrid1,%ZGM_GetCellIndex, 2, 2 To lIndex ' convert to index
                Control Send hDlgMain, %IDC_ZeeGrid1,%ZGM_GotoCell, lIndex, %False ' move to row/col
          '      Control Send hDlgMain, %IDC_ZeeGrid1,%ZGM_SetCursorCell, lIndex, %False ' move to row/col
          
          
          
          
              Case %WM_Command
                Select Case Cb.Ctl
                  Case %IDC_ZeeGrid1
                    Select Case Cb.CtlMsg
                      Case %ZGN_EDITCOMPLETE
          
                        ' get the cell index of the edited cell which triggered the event notification message ZGN_EDITCOMPLETE
                        ' the cell index Is stored In the program variable "index"
                        Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_GETEDITEDCELL, 0, 0 To lIndex
          
                        ' get the type of data in the cell.
                        Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_GETCELLTYPE, lIndex, 0 To lType
          
                        ' If the Type Of Data Is Not Numeric (lType <> 3), Color the background Of the cell YELLOW
                        ' also, Set the foreground (Text) Color To BLACK
                        If lType <> 3 Then
                          Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCELLBCOLOR, lIndex, 6  ' 6 = YELLOW (built-In Color palette)
                          Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCELLFCOLOR, lIndex, 0  ' 0 = BLACK (built-In Color palette)
                        Else
          
                          ' it's a numeric data type (itype==3)... continue processing...
          
                          ' Get the Double value Of the cell referenced by "index".
                          Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_GETCELLDOUBLE, lIndex, VarPtr(lValue)
          
                          If lValue <10 Or lValue >=100 Then
                            Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCELLBCOLOR, lIndex, 4  ' 4 = RED (built-In Color palette)
                            Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCELLFCOLOR, lIndex, 7  ' 7 = WHITE (built-In Color palette)
                          Else
                            Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCELLBCOLOR, lIndex, 2  ' 2 = GREEN (built-In Color palette)
                            Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCELLFCOLOR, lIndex, 0  ' 0 = BLACK (built-In Color palette)
                          End If
                        End If
                  End Select
                End Select
            End Select
          End Function
          
          
          Function PBMain () As Long
          
            Local lColumn1 As StringZ*100 : lColumn1 = "First" +Chr$(13)+"Column"
            Local lColumn2 As StringZ*100 : lColumn2 = "Second"+Chr$(13)+"Column"
            Local lColumn3 As StringZ*100 : lColumn3 = "Third" +Chr$(13)+"Column"
            Local lColumn4 As StringZ*100 : lColumn4 = "Fourth"+Chr$(13)+"Column"
            Local lColumn5 As StringZ*100 : lColumn5 = "Fifth" +Chr$(13)+"Column"
            Local lColumn6 As StringZ*100 : lColumn6 = "Sixth" +Chr$(13)+"Column"
          
            Local i     As Long
            Local hGrid As Dword
            hGrid = LoadLibrary("ZeeGrid.dll")
          
            Dialog New 0, "Demo ZeeGrid - PowerBASIC DDT", , , 500, 350, %WS_Popup Or %WS_Border Or %WS_DlgFrame Or %WS_SysMenu Or %WS_MinimizeBox Or %WS_ClipSiblings Or %WS_Visible _
              Or %DS_ModalFrame Or %DS_3DLook Or %DS_NoFailCreate Or %DS_SetFont, %WS_Ex_ControlParent Or %WS_Ex_Left Or %WS_Ex_LtrReading Or %WS_Ex_RightScrollbar, To hDlgMain
            Control Add "zeegrid", hDlgMain, %IDC_ZeeGrid1, "Demo ZeeGrid - PowerBASIC DDT", 5, 5, 490, 175, %WS_Child Or %WS_Visible Or %WS_Border
          
            ' dimension the grid For 10 columns.
            Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_DIMGRID       ,6    , 0
            Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SHOWROWNUMBERS,%TRUE, 0
          
            ' Set Column Header titles
            Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCELLTEXT, 1, VarPtr(lColumn1)
            Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCELLTEXT, 2, VarPtr(lColumn2)
            Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCELLTEXT, 3, VarPtr(lColumn3)
            Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCELLTEXT, 4, VarPtr(lColumn4)
            Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCELLTEXT, 5, VarPtr(lColumn5)
            Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCELLTEXT, 6, VarPtr(lColumn6)
          
            ' Create 5 rows Of Empty cells
            For i = 1 To 5
                  Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_APPENDROW, 0, 0
            Next i
          
            ' Set All six columns To be editable by the User
            For i = 1 To 6
              Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCOLEDIT, i, 1
            Next i
          
            ' auto Size All columns
            Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_AUTOSIZE_ALL_COLUMNS, 0, 0
          
            Dialog Show Modal hDlgMain, Call ShowhDlgMainProc
          
            FreeLibrary(hGrid)
          
          End Function

          Comment


          • #25
            When you can't find the correct tool for the job, grab a hammer. See %WM_InitDialog. This works for now.

            Frank
            Code:
            #Compile Exe
            #Dim All
            #Include "WIN32API.INC"
            #Include "ZeeGrid.inc"
            
            Global hDlgMain As Long
            %IDC_ZeeGrid1 = 150
            
            CallBack Function SHOWhDlgMainProc()
            
              Local lIndex As Long
              Local lType  As Long
              Local lValue As Double
            
              Select Case Cb.Msg
                Case %WM_InitDialog
            
            
                  Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_GETCELLINDEX, 1, 1 To lIndex
                  Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_GOTOCELL, lIndex, %False
            
                  Keybd_Event %VK_Down,0,0,0                  'press down arrow
                  Keybd_Event %VK_Down,0, %KeyEventF_KeyUp, 0 'release down arrow
                  Keybd_Event %VK_Up,  0,0,0                  'press up arrow
                  Keybd_Event %VK_Up,  0, %KeyEventF_KeyUp, 0 'release up arrow
            
            
            
                Case %WM_Command
                  Select Case Cb.Ctl
                    Case %IDC_ZeeGrid1
                      Select Case Cb.CtlMsg
                        Case %ZGN_EDITCOMPLETE
            
                          ' get the cell index of the edited cell which triggered the event notification message ZGN_EDITCOMPLETE
                          ' the cell index Is stored In the program variable "index"
                          Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_GETEDITEDCELL, 0, 0 To lIndex
            
                          ' get the type of data in the cell.
                          Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_GETCELLTYPE, lIndex, 0 To lType
            
                          ' If the Type Of Data Is Not Numeric (lType <> 3), Color the background Of the cell YELLOW
                          ' also, Set the foreground (Text) Color To BLACK
                          If lType <> 3 Then
                            Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCELLBCOLOR, lIndex, 6  ' 6 = YELLOW (built-In Color palette)
                            Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCELLFCOLOR, lIndex, 0  ' 0 = BLACK (built-In Color palette)
                          Else
            
                            ' it's a numeric data type (itype==3)... continue processing...
            
                            ' Get the Double value Of the cell referenced by "index".
                            Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_GETCELLDOUBLE, lIndex, VarPtr(lValue)
            
                            If lValue <10 Or lValue >=100 Then
                              Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCELLBCOLOR, lIndex, 4  ' 4 = RED (built-In Color palette)
                              Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCELLFCOLOR, lIndex, 7  ' 7 = WHITE (built-In Color palette)
                            Else
                              Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCELLBCOLOR, lIndex, 2  ' 2 = GREEN (built-In Color palette)
                              Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCELLFCOLOR, lIndex, 0  ' 0 = BLACK (built-In Color palette)
                            End If
                          End If
                    End Select
                  End Select
              End Select
            End Function
            
            
            Function PBMain () As Long
            
              Local lColumn1 As StringZ*100 : lColumn1 = "First" +Chr$(13)+"Column"
              Local lColumn2 As StringZ*100 : lColumn2 = "Second"+Chr$(13)+"Column"
              Local lColumn3 As StringZ*100 : lColumn3 = "Third" +Chr$(13)+"Column"
              Local lColumn4 As StringZ*100 : lColumn4 = "Fourth"+Chr$(13)+"Column"
              Local lColumn5 As StringZ*100 : lColumn5 = "Fifth" +Chr$(13)+"Column"
              Local lColumn6 As StringZ*100 : lColumn6 = "Sixth" +Chr$(13)+"Column"
            
              Local i     As Long
              Local hGrid As Dword
              hGrid = LoadLibrary("ZeeGrid.dll")
            
              Dialog New 0, "Demo ZeeGrid - PowerBASIC DDT", , , 500, 350, %WS_Popup Or %WS_Border Or %WS_DlgFrame Or %WS_SysMenu Or %WS_MinimizeBox Or %WS_ClipSiblings Or %WS_Visible _
                Or %DS_ModalFrame Or %DS_3DLook Or %DS_NoFailCreate Or %DS_SetFont, %WS_Ex_ControlParent Or %WS_Ex_Left Or %WS_Ex_LtrReading Or %WS_Ex_RightScrollbar, To hDlgMain
              Control Add "zeegrid", hDlgMain, %IDC_ZeeGrid1, "Demo ZeeGrid - PowerBASIC DDT", 5, 5, 490, 175, %WS_Child Or %WS_Visible Or %WS_Border
            
              ' dimension the grid For 10 columns.
              Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_DIMGRID       ,6    , 0
              Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SHOWROWNUMBERS,%TRUE, 0
            
              ' Set Column Header titles
              Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCELLTEXT, 1, VarPtr(lColumn1)
              Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCELLTEXT, 2, VarPtr(lColumn2)
              Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCELLTEXT, 3, VarPtr(lColumn3)
              Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCELLTEXT, 4, VarPtr(lColumn4)
              Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCELLTEXT, 5, VarPtr(lColumn5)
              Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCELLTEXT, 6, VarPtr(lColumn6)
            
              ' Create 5 rows Of Empty cells
              For i = 1 To 5
                    Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_APPENDROW, 0, 0
              Next i
            
              ' Set All six columns To be editable by the User
              For i = 1 To 6
                Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_SETCOLEDIT, i, 1
              Next i
            
              ' auto Size All columns
              Control Send hDlgMain, %IDC_ZeeGrid1, %ZGM_AUTOSIZE_ALL_COLUMNS, 0, 0
            
              Control Send hDlgMain, %IDC_ZeeGrid1,%ZGM_GetCellIndex, 2, 2 To i ' convert to index
              Control Send hDlgMain, %IDC_ZeeGrid1,%ZGM_GotoCell, i, %False ' move to row/col
            
              Dialog Show Modal hDlgMain, Call ShowhDlgMainProc
            
              FreeLibrary(hGrid)
            
            End Function

            Comment

            Working...
            X