Announcement

Collapse
No announcement yet.

Zeegrid - Any experience?

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

  • Frank Rogers
    replied
    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

    Leave a comment:


  • Frank Rogers
    replied
    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

    Leave a comment:


  • Frank Rogers
    replied
    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

    Leave a comment:


  • Jean-Pierre LEROY
    replied
    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

    Leave a comment:


  • Paul D. Elliott
    replied
    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.

    Leave a comment:


  • Johan Klassen
    replied
    I am confused by this statement in the license: "You may not publish, in any form, instructions, manuals, or tutorials on ZeeGrid usage."

    Leave a comment:


  • Paul D. Elliott
    replied
    Well, my problem doesn't seem to be v10.03.

    Based on the screens from some other programs, it seems to be related to the high-definition monitor and related drivers in this laptop.
    I'll continue trying little changes ( such as font/colors ) in the demo. It'll be after the 7th of May before I can try testing on my older
    Windows 2000 desktop with a semi-standard video setup.

    Leave a comment:


  • jcfuller
    replied
    Ok got it. Need to add this line:
    SendMessage hgrid, %ZGM_SETCOLUMNHEADERHEIGHT,10,0

    James

    Leave a comment:


  • jcfuller
    replied
    No headers build 37 on Win10 with PbWin 10.04
    headers show with build 36.

    James

    Leave a comment:


  • Jim Robinson
    replied
    Jean-Pierre.
    Thanks for the links and demo. Now I have something else to play with.

    Paul,
    I'm running PB Win v 10.04 with José's includes, and the demo is working as expected on my Win 10 machine. I don't have 10.03 to try it with.

    Just for fun, I compiled it with PB Win V 9.05 using standard PB includes. After changing STRINGZ to ASCIIZ, it works as expected.

    Leave a comment:


  • Jean-Pierre LEROY
    replied
    Originally posted by Paul D. Elliott View Post
    Are your screen shots from a PB-version or from the C-version?
    Paul, it is a screen shot from the PB version; I've no idea why you can't see the column headings or row numbers. Weird.

    Leave a comment:


  • Paul D. Elliott
    replied
    Jean-Pierre,

    Thanks for the translation to PB of the demo program. But I seem to have a problem.

    On my current laptop, I have Windows 10 but only have PB Win v10.03 ( I must have copied an older PB directory .. my problem which I'll have to wait a week to fix).
    I'm unable to see any of the column headings or row numbers. I've tried F8 to bring up the toolbar but none of those options will show
    any of the headings. Are your screen shots from a PB-version or from the C-version? I've tried switching between the standard PB Includes and Jose's Includes
    but can not see any difference.
    Or can it be due to the difference between a window and a dialog?
    Last edited by Paul D. Elliott; 17 Apr 2016, 10:14 AM. Reason: added last line regarding window or dialog

    Leave a comment:


  • Jean-Pierre LEROY
    replied
    David Hillard has just published complete documentation about ZeeGrid's messages and notifications.

    http://www.kycsepp.com/ZeeGrid_Docs/ZeeGrid_index.html


    Leave a comment:


  • Jean-Pierre LEROY
    replied
    Click image for larger version

Name:	Demo ZeeGrid.png
Views:	2
Size:	11.6 KB
ID:	747002


    For those of you who would like to go futher, you will find below 2 complete PowerBASIC demos (one in DDT code and the other one in SDK code); this demo was written in C by David Hillard:

    The code below creates a small grid and sets each cell to be editable by the user. When the user presses enter after editing, or clicks off the edited cell, ZeeGrid sends the ZGN_EDITCOMPLE message to the application. If the entered data is not a number, the cell is colored with black text on a yellow background. If it is number, it’s checked to see if the value is greater than or equal to 10 and less than or equal to 100. If it is in this range, the cell is colored with black text on a green background. If it is outside this range, it is colored with white text on a red background.
    Attached Files
    Last edited by Jean-Pierre LEROY; 17 Apr 2016, 05:08 PM. Reason: Add SDK version

    Leave a comment:


  • Jean-Pierre LEROY
    replied
    For those of you who would like to test ZeeGrid with PowerBASIC you will find below ZeeGrid.inc (my translation of the ZeeGrid.h).
    Attached Files
    Last edited by Jean-Pierre LEROY; 16 Apr 2016, 04:52 PM.

    Leave a comment:


  • Jean-Pierre LEROY
    replied
    ZeeGrid has been made by David Hillard and is completely free.

    The DDL and the C header (ZeeGrid.h) are available on his web site :

    http://www.kycsepp.com
    Last edited by Jean-Pierre LEROY; 4 Apr 2016, 04:53 AM. Reason: Typo error.

    Leave a comment:


  • Eros Olmi
    replied
    Sorry to have asked for the file. Just a snap to convert it.

    Demo DLL is limited to 3 columns, too little to test it.
    Anyhow, seems a good grid, worth to try and test.
    Cost is not so low.

    Eros


    ------------------
    mailto:[email protected][email protected]</A>
    www.thinbasic.com
    "If PowerBasic doesn't have the solution, then you've got the wrong problem."

    Leave a comment:


  • Terence McDonnell
    replied
    Originally posted by Eros Olmi:
    "ZeeGrid.inc" ?
    Is it available?
    Thanks
    Eros
    Hi Eros;

    As was probably painfully obvious from my previous posts in this
    thread, I am not used to including external controls into apps
    I make in PB. Generally (and probably to my detriment) I
    subscribe to the theory that if the only tool you have is a
    hammer, every problem looks like a nail.

    My hammer, generally, is PB DDT (plus ms common controls, etc.).

    Even using COM with MS word or excel or Project (which I have done
    on multiple occasions) makes my eyes glaze over (the whole
    variant translation thing seems cludged).

    This particular control, however struck me as having "the right
    idea", in that it is available to all sdk languages.

    I suck at translating INCLUDE files (hacked up an MySQL one) but
    this one isn't even a translation - there are no functions,
    it's just a "search-and-replace" between "define" and "%name".

    !!!!! HUGE DISCLAIMER !!!!!

    Guys - this is just some control I ran across on the internet
    whilst I was looking for something else. I have no vested
    interest in whether or not you even look at it. It probably
    sucks, I don't know.

    In the 2 hours I have spent messing around with it,
    I can put a grid on a form, add rows, blah, blah, blah....

    The point of my post was just to see whether or not anyone
    had any experience with the control (vendor).

    Seems to work - will do some test and post my results...

    Seeya - Terence.


    ------------------
    Code:
    #COMPILE EXE
    #DIM ALL
    #INCLUDE "WIN32API.INC"
    #INCLUDE "ZeeGrid.inc"  '--- SIMPLE TRANSLATION
    '---YOU CAN DOWNLOAD BOTH INC FILE AND DOCS FROM WWW.ZEEGRID.COM 
    %hDlgMain_Grid1 = 150
    GLOBAL hDlgMain AS LONG
    '==============================================================================
    FUNCTION PBMAIN () AS LONG
    
    	LOCAL hGrid AS DWORD
    	hGrid = LoadLibrary("ZeeGrid.dll")
    
    	DIALOG NEW 0, " Generic Process", , , 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, %hDlgMain_Grid1, "My Freaking New Grid", 5, 5, 490, 175, %WS_CHILD OR %WS_VISIBLE OR %WS_BORDER
    
    	CONTROL SEND hDlgMain, %hDlgMain_Grid1, %ZGM_SHOWVSCROLL, 0, 0
    
    	LOCAL i AS LONG
            '---ADD 100 EMPTY ROWS...
    	FOR i = 0 TO 100
                CONTROL SEND hDlgMain, %hDlgMain_Grid1, %ZGM_APPENDROW, 0, 0
    	NEXT
    
    	DIALOG SHOW MODAL hDlgMain, CALL ShowhDlgMainProc
    
    	FreeLibrary(hGrid)
    
    END FUNCTION
    '==============================================================================


    [This message has been edited by Terence McDonnell (edited March 03, 2006).]

    Leave a comment:


  • Elias Montoya
    replied

    Chceking on the competence
    are there any screenshots?

    ------------------
    Egrid32 Grid Control - Form Designer for Egrid32 - Print Engine for Egrid32
    www.sweetheartgames.com - Visit the Forums! =)

    Leave a comment:


  • Eros Olmi
    replied
    "ZeeGrid.inc" ?
    Is it available?
    Thanks
    Eros

    ------------------
    mailto:[email protected][email protected]</A>
    www.thinbasic.com
    "If PowerBasic doesn't have the solution, then you've got the wrong problem."

    Leave a comment:

Working...
X