Object Plugin : GridEx

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • 5tupot1
    Forum Member
    • Mar 2012
    • 7

    #16
    Thanks reteset.

    Automatic Row Height to Fit would be a great feature. I'm using a string count function at the moment with a simple maths equation to set the row height automatically. Its not perfect, but will do for the moment.

    In terms of the Print button, you have given me some food for thought there. I'm going to look at another way of checking the total pixels of each cell width. If the total exceeds the width of an A4 Sheet then only one cell (multi line cell) will resize so it fits. Problem I'm facing now is that the row height does not resize automatically so some text is cut off in the cell.

    Comment

    • Imagine Programming
      Indigo Rose Customer
      • Apr 2007
      • 4248

      #17
      I haven't been around for a while, and to see this!
      Very nice work Reteset!
      Bas Groothedde
      Imagine Programming :: Blog

      AMS8 Plugins
      IMXLH Compiler

      Comment

      • 5tupot1
        Forum Member
        • Mar 2012
        • 7

        #18
        Is there an action i can call to GetRowHeight?

        From the action list there are the options to SetRowHeight and SetColumnWidth, but i cannot Get this information.

        This seems like a simple task, but can find the option to do it anywhere.

        Any help would be appreciated.

        Comment

        • Cybergraph
          Indigo Rose Customer
          • Feb 2007
          • 1633

          #19
          Originally posted by 5tupot1 View Post
          Is there an action i can call to GetRowHeight?

          From the action list there are the options to SetRowHeight and SetColumnWidth, but i cannot Get this information.

          This seems like a simple task, but can find the option to do it anywhere.

          Any help would be appreciated.
          Assign global variables to the following data returned by the event OnRowSize:

          resized_row_index = e_Row:
          (number) The index of the row.

          resized_row_height = e_Height:
          (number) The new height of the row

          In this way you will always know which was the resized row and its height.
          We are slowly invading your planet to teach lazy humans to read the user manual.
          But don't be scared: we are here to help.

          Comment

          • 5tupot1
            Forum Member
            • Mar 2012
            • 7

            #20
            Fantastic Cybergraph. Thanks for the quick response. Thats exactly what i was looking for!

            Another one for anyone....

            There is an action in this object GridEx.MoveCurrentRow("spreadsheet1", GEX_PAGEDOWN)

            Is there any way to to GetPageHeight or GetPageWidth?

            Also am i able to set these eg. SetPageHeight or SetPageWidth?

            Thanks

            Comment

            • Cybergraph
              Indigo Rose Customer
              • Feb 2007
              • 1633

              #21
              If you need to get or set the dimensions of the GridEx object, you can use standard Plugin.GetSize / Plugin.SetSize functions.
              We are slowly invading your planet to teach lazy humans to read the user manual.
              But don't be scared: we are here to help.

              Comment

              • 5tupot1
                Forum Member
                • Mar 2012
                • 7

                #22
                It's more for printing.

                I need to set the height of a page in pixels to fit an a4 sheet.

                At the Tom of each page will bea header and each page will have a "page total".

                I also need to ba able to count total number of pages.

                Setting the object dimensions is not exactly what I need.

                There is a value for a page height in the object. If you use the action I mentioned before, this moves a row to the next page. I ran some tests with it and found that if you try with default row height of 25 pixels it moves down x amount of rows.

                If you try again, but this time adjust the height of a row some where in the middle, the amount of rows moved is different from x. It is actually less. This means there is a pixel value somewhere for a page height in pixels. I need to be able to change this value depending on the paper size selected.

                Any ideas?

                Comment

                • m2jalali
                  Forum Member
                  • Apr 2007
                  • 21

                  #23
                  How can delete all items in GridEx
                  for example in grid
                  Grid.DeleteAllItems("Grid1")

                  Comment

                  • m2jalali
                    Forum Member
                    • Apr 2007
                    • 21

                    #24
                    solved

                    Originally posted by m2jalali View Post
                    How can delete all items in GridEx
                    for example in grid
                    Grid.DeleteAllItems("Grid1")
                    Code:
                    GridEx.SelectRange("Plugin1",0,0,GridEx.GetNumberRows("Plugin1")-1,GridEx.GetNumberRows("Plugin1")-1)
                    	GridEx.ClearSelections("Plugin1");

                    Comment

                    • RizlaUK
                      Indigo Rose Customer
                      • May 2006
                      • 5552

                      #25
                      maybe this is better?

                      Code:
                      function GridEx.DeleteAllItems(sObject)
                      	GridEx.SetUpdate(sObject, false);
                      	for i=0, GridEx.GetNumberRows(sObject) do
                      		GridEx.DeleteRow(sObject, 0);
                      	end
                      	GridEx.SetUpdate(sObject, true);
                      end
                      
                      -- Test
                      GridEx.DeleteAllItems("Plugin1");
                      Embrace change in your life, you never know, it could all work out for the best

                      Comment

                      • m2jalali
                        Forum Member
                        • Apr 2007
                        • 21

                        #26
                        language right to left in Gridex

                        Does GridEx Support right to left?

                        i use this code for Grid
                        here is the function to change read order of Grid object (reteset)
                        function SetRightToLeft(hWnd)
                        local WS_EX_LAYOUTRTL = 0x00400000;
                        local GWL_EXSTYLE = -20;
                        local nOldLong = DLL.CallFunction("User32.dll", "GetWindowLongA", (hWnd..","..GWL_EXSTYLE), DLL_RETURN_TYPE_INTEGER, DLL_CALL_STDCALL);
                        local nNewLong = DLL.CallFunction("User32.dll", "SetWindowLongA", (hWnd..","..GWL_EXSTYLE..","..(nOldLong+WS_EX_LAYO UTRTL)), DLL_RETURN_TYPE_INTEGER, DLL_CALL_STDCALL);
                        return (tonumber(nNewLong) > 0);
                        end
                        and this is the usage of that function
                        local tblGridProps = Grid.GetProperties("Grid1");
                        SetRightToLeft(tblGridProps.WindowHandle);
                        Grid.SetRedraw("Grid1", true, true); -- causes a whole redraw in grid object
                        but GridEx and Plugin has not GetProperties
                        ?

                        Comment

                        • reteset
                          Indigo Rose Customer
                          • May 2006
                          • 1692

                          #27
                          Originally posted by m2jalali View Post
                          Does GridEx Support right to left?
                          Unfortunately id does not support for now , because nobody needed it

                          Originally posted by m2jalali View Post
                          GridEx and Plugin has not GetProperties?
                          That function (i provided for Grid Object) will not work even if you get window handle
                          because this grid requires a custom setup to get RTL work properly

                          i will look into that and see what can i do

                          Thanks
                          amsplugins.com Is Closed.

                          Facebook Page

                          Comment

                          • m2jalali
                            Forum Member
                            • Apr 2007
                            • 21

                            #28
                            I hope that you can help and solve this problem
                            we wait ...
                            thanks

                            Comment

                            • Shrek
                              Forum Member
                              • Jul 2012
                              • 723

                              #29
                              Hello again, how would I remove the border from a cell thats selected or turn off cell selection?

                              Comment

                              • Shrek
                                Forum Member
                                • Jul 2012
                                • 723

                                #30
                                Anyone know how I could remove the border from a cell thats selected or turn off cell selection?

                                Comment

                                Working...
                                X