Announcement

Collapse
No announcement yet.

Virtual Table Control

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

  • Virtual Table Control

    This is the discussion thread for the virtual table control found here.

    The routines intended for external use are in mainTable.bas.
    LarryC
    Website
    Sometimes life's a dream, sometimes it's a scream

  • #2
    Hi Larry,
    By themed, you mean it has a non-default color scheme, yes?

    Comment


    • #3
      Originally posted by Gary Beene View Post
      Hi Larry,
      By themed, you mean it has a non-default color scheme, yes?
      No, the column headers will be drawn in the header style of your windows theme if useTheme is true and as buttons if not. You'll see the default, hot, and pushed renderings that reflect your current theme.

      Also many of the values will default to appropriate system colors. Still working on parts of this, like theme / color changes and using more "theme" colors versus system colors when appropriate.
      LarryC
      Website
      Sometimes life's a dream, sometimes it's a scream

      Comment


      • #4
        Larry,
        Here's what I'm getting:

        image in background is an aero theme (doesn't matter which theme I pick, the image is pretty much the same).

        image in foreground is Windows Classic theme.

        Does this look as intended?

        Comment


        • #5
          Currently yes. Still working on content area. If you comment out the samples of overriding the values, you'll see selection colors change with your themes (if you restart) still adding theme change support.
          LarryC
          Website
          Sometimes life's a dream, sometimes it's a scream

          Comment


          • #6
            Working with Themes is important if one wants to write custom controls.

            Certain elements of a custom control need to be themed, so when run on a system using themes they look like all the other windows controls.

            The problem with Themes though is when you run an app on a system with either themes turned off or no theme support (ie.95,98).

            This is why it is best to dynamically load the theme DLL (LoadLibrary) and to call the theme api's using CALL DWORD. If themes are not available, then provide a standard GDI call to replace them.

            This is what I do.

            For example I do a lot with ownerdraw and it is important to have access to specific theme elements. The majority of theme elements often aren't used, but there are a few which are critical.
            Chris Boss
            Computer Workshop
            Developer of "EZGUI"
            http://cwsof.com
            http://twitter.com/EZGUIProGuy

            Comment


            • #7
              Updated selection and hot drawing to be similar to explorer. Also commented out customization so grid shows default look. If you want to explore the various looks the table supports, try uncommenting some of the customization code.

              Change the values in SetUseTheme, SetSelectRow, SetTablelines, and SetAlternatingRows to see the effects of changing them.

              Perhaps a better title for the table would be styled virtual table at this point since the only "themed" component is the grid headers that theme themselves based on platform. You can apply your own colors schemes though. Also if you don't customize the colors, they will change with system color changes.
              LarryC
              Website
              Sometimes life's a dream, sometimes it's a scream

              Comment


              • #8
                Added row headers. Row/column headers can be turned on and off, and row header widths set.

                Added frozen rows/columns with a frozen back color.

                Added UserPainting that can either allow customizing draw values or user performed painting on a per feature basis. Features are Headers, selected background, hot tracked background, cell background, and cell foreground.

                Row / column headers can be themed, button, or flat and can be set indendently. Defaults to themed if application has a manifex and button if it does not.

                Click image for larger version

Name:	table.jpg
Views:	1
Size:	61.9 KB
ID:	727215
                Last edited by Larry Charlton; 15 Aug 2011, 09:50 AM.
                LarryC
                Website
                Sometimes life's a dream, sometimes it's a scream

                Comment


                • #9
                  Added user notification for selected item and cell change. Selection key defaults to space but can be changed.

                  Also updated demo so you can try some preset values. Exe is also included.
                  LarryC
                  Website
                  Sometimes life's a dream, sometimes it's a scream

                  Comment


                  • #10
                    Updated sample, added alternating rows, switched to owner drawn listbox, cleaned up text, added two small csv data sets in addition to the generated data.
                    LarryC
                    Website
                    Sometimes life's a dream, sometimes it's a scream

                    Comment


                    • #11
                      Added mouse column resizing, made configurable
                      Fixed some drawing artifacts
                      Made hot-tracking configurable
                      Updated demo selection list
                      LarryC
                      Website
                      Sometimes life's a dream, sometimes it's a scream

                      Comment


                      • #12
                        Really great great example.
                        Thanks for sharing.
                        thinBasic programming language
                        Win10 64bit - 8GB Ram - i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

                        Comment


                        • #13
                          Glad you liked it. Stay tuned, having fun with it, more to come
                          LarryC
                          Website
                          Sometimes life's a dream, sometimes it's a scream

                          Comment


                          • #14
                            Change row/column parameters to LONG or DWORD?

                            Great code!

                            SUB Table_SetDataSource2( BYVAL hWnd AS DWORD, BYVAL getData AS DWORD, BYVAL setData AS DWORD, BYVAL rows AS INTEGER, BYVAL cols AS INTEGER ) EXPORT COMMON


                            Code:
                            'quick and dirty create lots of rows
                            FUNCTION PBMAIN () AS LONG
                              LOCAL x AS LONG
                              OPEN "emp.tsv" FOR OUTPUT AS #1
                              PRINT #1, "Header"
                              FOR x = 1 TO 1000000
                                PRINT #1, USING$("row #,",x)
                              NEXT
                            END FUNCTION
                            
                            
                            'increased 1000 to 9,000,000 
                            SUB LoadData( filename AS WSTRING )
                               'suggest changing to using filescan
                              REDIM tLines(9000000)
                              DIM cnt AS LONG
                              LOCAL hFile AS LONG
                              OPEN filename FOR INPUT AS #hFile
                              WHILE NOT EOF(hFile)
                                LINE INPUT #hFile, tlines(cnt)
                                IF TRIM$(tlines(cnt))<>"" THEN
                                  INCR cnt
                               END IF
                            WEND
                            REDIM PRESERVE tlines(cnt-1)
                            CLOSE #hFile
                            END SUB
                            Last edited by Mike Doty; 10 Feb 2015, 02:37 PM.

                            Comment

                            Working...
                            X