Jump to content


Photo

NextGrid5 -> NextGrid6 upgrade


  • Please log in to reply
126 replies to this topic

#61 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 02 March 2018 - 06:31 PM

Hi, Boki:
Thank you for you quick response!
A couple of followup questions:
 
1. "You can check if is INxWrapable or use Support method (as can be used for all interfaces in Delphi)"
 
How do I actually code for the check if INxWrapable? Can you give me an example.
So, I am not familiar with a "support method" which can be used in Delphi interfaces. Can you point me to an example in your code or what I need to google to find out more?
 
Thank you,
Chuck


Hi,

If you use interfaces in Delphi I suggest using Support. For example:

  if Supports(FRow, INxCellsRow, Refr) then
  begin
    Refr.SomeProperty...
  end;
In same way you can check if object support INxWrapable.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#62 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 02 March 2018 - 06:34 PM

Hi, Boki:
 
"IgnoreDefaults if set to True (default, for optimization when adding thousands of rows) DefaultValue property of Column will be ignored."
 
Back to my original question: how do I make sure I get the same effect in the NG6 AddChildRow as NG5 AddChildRow with crLast?
 
Is crLast, i.e. adding the child row to the bottom of the child rows, default in NG6? If I want to add the child row FIRST, i.e. top of the child rows, how would I do that? In other words, what are the "defaults" of this method that are ignored and can they be manipulated?
 
Thank you,
Chuck 


Hello Chuck,

Maybe you can use it like this:

  NextGrid61.Row[2].ChildRow[2].InsertChildRow(0, 1); // 0 is first row.
I will try to add something similar like in v5.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#63 BelangerC

BelangerC

    Senior Member

  • Members
  • PipPip
  • 221 posts
  • Location:Richmond, CA USA
  • Interests:Alternative medicine, programming for

Posted 02 March 2018 - 10:42 PM

Thank you, Boki:

NextGrid61.Row[2].ChildRow[2].InsertChildRow(0, 1); // 0 is first row.

 

I am assuming this is how you are suggesting that I add a row as FirstChild?

 

I looked over my code completely and nowhere do I actually add a row as first child. Everywhere is crLast. So, I just want a confirmation that the default for AddChildRow is to add the new row to the bottom of child rows? Yes? I could not actually find your code that does the addition.

 

Thank you,

Chuck



#64 BelangerC

BelangerC

    Senior Member

  • Members
  • PipPip
  • 221 posts
  • Location:Richmond, CA USA
  • Interests:Alternative medicine, programming for

Posted 02 March 2018 - 10:54 PM

Hi,

If you use interfaces in Delphi I suggest using Support. For example:
 

  if Supports(FRow, INxCellsRow, Refr) then
  begin
    Refr.SomeProperty...
  end;
In same way you can check if object support INxWrapable.

 

 

Hi, Boki:

 

Can I use SUPPORTS() function in my app if it does not specifically use interfaces, instead using your components which do?

Assuming I can, Supports(NxColumn, INxWrapable, Refr ) , would Refr be the NxColumn I am testing? Can I use the shorter form and still get true/false: if Supports(NxColumn6 to be tested, INxWrapable ) then...?

 

Thank you!

Chuck



#65 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 08 March 2018 - 01:21 AM

Hi Chuck,

Sorry for few days delay,

Yes you can use. I suggest reading a little bit about interfaces. For example I like 2 books from Nick Hodges and they helped me a lot with interfaces. They becoming very used today.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#66 BelangerC

BelangerC

    Senior Member

  • Members
  • PipPip
  • 221 posts
  • Location:Richmond, CA USA
  • Interests:Alternative medicine, programming for

Posted 09 March 2018 - 12:19 PM

Hi, Boki:

Thank you for the book recommendation. I will be ordering it (i.e. the first one by Hodges) from Amazon tomorrow. Looks like it covers a number of topics which I am not aware of how to use in Delphi.

 

I am at a crossroads with this project and either need to drop the NextGrid5 to NG6 conversion and revert everything back to NG5 or finish the conversion. We are really close at this point, but I need your help to wrap it up.

 

How are you doing with adding the events and methods which seem to be missing?

 

It may be helpful to know that I have literally hundreds of NextGrid based tables in my application. They are created using stored setup information in a local database and created as the form is opened. They change depending on the data associated with a treeview node

 

I have asked several questions recently which I don't have the answers to. Below listed are my questions and the specific properties, events and methods which appear to be missing in NG6 after already much back and forth by you and I. Consider this to be an updated list of the help I am requesting.

 

1. ADDCHILDROW: is the default behavior to add the child last? i.e. equivalent to NG5 crLast?

 

2. It would be helpful to add something like Column.IsWrappable function

 

3. Really need the following events or their equivalent for NextGrid6:

 

    a. OnCellFormatting; this really needs to be at the grid wide level; OnSetCell at the column level just does not work for my application.

    b. OnApplyEditText

    c. OnEditText 

    d. OnColumnResize = Column.OnResize Can you confirm this equivalency? Again, it would be better to have a Grid level event, not at the column.

    e. OnEdit 

    f.  OnHeaderClick: really could use a grid level event, rather than in the Column.Header
    g. OnHeaderDblClick: same here.
    h. OnCellHint 
     i. OnChange
     j. OnCustomDrawHeader 

     k. OnColumnResize

 

4. Grid Methods/Properties

     a. GetLastChild()

     b. ReadOnly

     c. VisibleRows

     d. InnerWidth

     e. RefreshRange

     f.  RefreshColumn

     g. GetCellTop

     h. SearchNext

      i. GetLevel

 

5. Column properties, events, methods

     a. Display

     b. OnButtonClick = TNxMemoColumn6 no longer has button; I need button to launch full text editor for memo.

     c. ScrollBars = no longer a property for MemoColumn; actually the memo column stores large text info, but only displays the row height worth of text. 

     d. TNxMemoInplaceEdit: I use this in a number of tables; it is essentially a memo column with a button, which I use to fire a full editor in a dialog.

     e. TNxComboBox6(Columns[ACol]).Editor.DroppedDown := True; Editor and DroppedDown do not exist.

     f. cmboSelection := NXPathRelativeTo.InputValue; InputValue does not exist

    g. Column.Options: 

 

coCanClick = ?
coSearchColumn = ?
coImageForIcon = ?

 

6. Grid Column adding dialog in design time: AV when dbl click on grid with columns. Column editor pops up without any columns. 

 

I believe that is the complete list of remaining items. Can you give me a status update? I have someone paying me to do this conversion who is getting impatient with the amount of time necessary. Right now it would be great if I could successfully compile my app in Delphi 10.2/Tokyo.

 

Thank you,

Chuck



#67 BelangerC

BelangerC

    Senior Member

  • Members
  • PipPip
  • 221 posts
  • Location:Richmond, CA USA
  • Interests:Alternative medicine, programming for

Posted 11 March 2018 - 01:02 PM

Also:

 

Columns.ChangePosition

 

How do I set GridView1.HeaderStyle := hsAuto; Or is this something no longer necessary?

 

or: GridView1.SortedStyle := soWhite; or soDefault? or equivalent?

 

Grid.IsTextFit()

 

Thank you,

Chuck



#68 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 12 March 2018 - 06:59 PM

Hi,

Please note that it will take some time to add all properties/methods. Also I'm not able to add them all (ones that I'm not sure, I don't answer yet).

AddChildRow - add at the end.
RefreshRange - ActiveView.RefreshRow(FromRow, ToRow);
InnerWidth - ActiveView.DataRect.Width (TRect)

FindText method have array property where you can include columns you want to search. I will try to add few more overloaded events.

I will try to mirror some of this events to grid too.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#69 BelangerC

BelangerC

    Senior Member

  • Members
  • PipPip
  • 221 posts
  • Location:Richmond, CA USA
  • Interests:Alternative medicine, programming for

Posted 12 March 2018 - 10:19 PM

Thank you, Boki, for your continuing efforts to help me with my app's NG5 to NG6 conversion.

 

We certainly are much closer, but the fact remains that there are some critical properties and methods missing. At this point, my income is coming under jeopardy from the delay, so I am deciding to go back to using NG5. This should allow me to at least be able to compile my application in the new Delphi Tokyo and then I can move on to program additions and changes that the person who is paying me wants.

 

This way we can at a later date upgrade to NG6 and it would be possible for me to change the static NextGrids that I have in the application on a one by one basis. I hoping that by doing this it will give you the time you need to give us (meaning NextGrid 5 users) all an upgrade path from NextGrid 5 to NextGrid 6.

 

Looking forward to upgrading to NextGrid 6!

Chuck



#70 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 13 March 2018 - 06:08 PM

Hi,

Yes, I agree. It's better that you start small with replacing few of them first.

I will try to compose document for migrating from v5 to v6. Maybe I can use some of the items you listed here in topic.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#71 BelangerC

BelangerC

    Senior Member

  • Members
  • PipPip
  • 221 posts
  • Location:Richmond, CA USA
  • Interests:Alternative medicine, programming for

Posted 08 June 2018 - 05:05 AM

Hi, Boki:

 

Just checking in on the NG5 to NG6 conversion. I downloaded the latest NG6 update and it still looks like there are a number of grid events still missing. As I am wrapping up the conversion of my program to Delphi 10.2, I wanted to try to change one NG5 grid (of the many in my program) that for whatever reason was on occasion causing very strange screen redraws (sometimes the grid was black, sometimes it contained images from other parts of the screen). The lack of the needed events makes the NG6 update of that particular grid not possible. Also, when I click on Active Viewer (I think that is what it is called) in the grid, the viewer pops up, but almost every time goes into "not responding" mode and eventually, I have to restart Delphi. What's up with that? Can you fix that?

 

Any possible time line for the other events and properties?

 

Thank you!

Chuck



#72 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 09 June 2018 - 03:11 PM

Hi,

I will try to add couple of more items from your list. Again, I will probably not add them all but I hope that you will be able to switch.

If you can describe me a little bit more about this ActiveView crash maybe I can fix it now? I'm not seeing it as much I open/close views.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#73 BelangerC

BelangerC

    Senior Member

  • Members
  • PipPip
  • 221 posts
  • Location:Richmond, CA USA
  • Interests:Alternative medicine, programming for

Posted 29 June 2018 - 01:16 PM

Hi, Boki:

Sorry for the delay in response, getting the rest of my project upgraded and now am adding a new form in which I will be trying NG6. Just downloaded the latest NG6 update (6/2018).

Anyway, I am still seeing the issue:

working in Delphi 10.2

add a new NextGrid6 to a form, right click on grid, then click on ViewsEditor. Editor pops up, I try to click on the ReportsView icon and the dialog locks up ("not responding") and then delphi locks up with me needing to restart it. I saw your video and no options are available either (grid lines, etc)

 

Same issue when working with the ColumnsEditor.

Right now I cannot get anywhere with NG6. 

Back to NG5! 

Chuck



#74 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 01 July 2018 - 10:11 PM

Hi Chuck,

Definitely not sure why you can not open Views Editor anymore. Maybe old and new files have been mixed and installation become corrupted.

If you maybe have other pc, maybe you can try it there just for test.

I usually if something similar happens delete BPL files and re-install packages.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#75 BelangerC

BelangerC

    Senior Member

  • Members
  • PipPip
  • 221 posts
  • Location:Richmond, CA USA
  • Interests:Alternative medicine, programming for

Posted 05 July 2018 - 10:25 AM

Thank you, Boki:

 

That solved the issue. I can now at least try to include a test replacement of one of many grids in my project. If anything specific comes up regarding differences in functionality, I will ask for help.

 

Chuck



#76 BelangerC

BelangerC

    Senior Member

  • Members
  • PipPip
  • 221 posts
  • Location:Richmond, CA USA
  • Interests:Alternative medicine, programming for

Posted 05 July 2018 - 10:13 PM

Hi, Boki:

 

As I stated, I plan to replace a single grid, the one which causes the most trouble as NG5 during screen drawing, with a NG6. I will be presenting issues one or only a couple at a time:

 

Missing OnApplyEditText event.

 

In my code I am doing:

 
 WITH Grid DO
  BEGIN
      WITH Columns[ACol].Editor DO
    BEGIN
      Color := clYellow;
      Font.Color := clBlack;
      Font.Style := [fsBold];
    END;
  END; // with grid
 
Is there some other event I can do this to get the same effect?
 
Thank you,
Chuck


#77 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 06 July 2018 - 12:47 AM

Hi,

Maybe next article can help you:
http://developer.ber...=683&lang=en-us

I am tipping on OnInplaceEditInsert or maybe OnGetInplaceEdit?
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#78 BelangerC

BelangerC

    Senior Member

  • Members
  • PipPip
  • 221 posts
  • Location:Richmond, CA USA
  • Interests:Alternative medicine, programming for

Posted 06 July 2018 - 03:05 AM

Hi, Boki:

Thank you for your response. I will look at that and let you know if I have further questions.

Here is another:

 

Missing Grid.GetCellTop.

 

In a routine called by OnCellDblClick, I create a panel which lays over the grid's cell. Here is the routine to show the use of GetCellTop in context: Thank you for your help in either adding this method or pointing me to another that would give me what I need.

Chuck

 

With Grid do

begin

WITH WizTableCellPanel DO
          BEGIN
            // 0th col, thus only left side of cell
            // PanelStart := GridSpace[TGridLinePosition(lpLeft)];
            PanelStart := 0;
 
            Parent := Grid;
            Align := alNone;
            BevelOuter := bvRaised;
            // 3/26/08 do not make wider but make longer for larger fonts. Similar
            // in principle to WizAddRTFtoLabel, but in multiple units of row height
            // 10/22/08 make it the same height as the Row for now
            // Below height is arbitrary and reset below RTF creation to match the actual text
            Height := Trunc(1.5 * RowHeight[SelRow]);
            // RowSize; is the general setting; not specific row
            // add width of indicator
            // Left := Trunc((Gridview1.Width-GridView1.InnerWidth)/2) + PanelStart;
            //2/20/18 ActiveView now
            CellRect := ActiveView.GetCellRect(SelCol, SelRow);
 
            Left := CellRect.Left;
 
            Name := 'plTableCell';
 
            // Top := HeaderSize + GridSpace[TGridLinePosition(lpTop)];
            Top := GetCellTop(SelCol, SelRow);
            Width := Columns[SelCol].Width;
            Visible := True;
            Caption := '';
 
          END; // WizTableCellPanel
End;


#79 BelangerC

BelangerC

    Senior Member

  • Members
  • PipPip
  • 221 posts
  • Location:Richmond, CA USA
  • Interests:Alternative medicine, programming for

Posted 06 July 2018 - 03:21 AM

Hi, Boki:

 

Could you please direct me to an alternative to how I have been using Grid.GetLevel? Thank you!

 

Here is another apparent missing method:

 

Grid.GetLevel

 

In an OnDragOver event I have the following code to show the context of how I use GetLevel:

 

 var
    GridSource, GridSender : TNextGrid6;
    SourceRow, SenderLevel : Integer;
 
begin
 // need this to determine if source and sender agree for application and
    // for Drag/Drop to even work
 
    // This event affects dragging intitiated by the grid itself, i.e. in setting row index
    // Restrictions: must be to itself; must be a visible row; must be at the same level
    // as the selected row
    // Reason: you would have to update the Parent_ID in the table; it doesn't make
    // much sense; and this way you can rely on the close session to call the reset index
    // routine which sets the table to the new index
 
    //2/27/18 In order to cast ActiveView, I need to disconnect the Grid from the phrase
    //Thus all this code to isolate the grids
 
    if (Sender is TNextGrid6) and (Source is TNextGrid6) then
    begin
     GridSource := Source;
     GridSender := Sender;
 
     with GridSource do
     begin
      SourceRow := TNxReportGridView6(ActiveView).GetItemAtPos(x,y);
     end;
     with GridSender do
     begin
       SenderLevel := GetLevel(TNxReportGridView6(ActiveView).GetItemAtPos(X, Y));
     end;
    end;
 
     if (SourceRow > -1) and (SenderLevel = Wizard.RowLevelBeingDragged ) then
 
      //(TNextGrid6(Source).GetRowAtPos(X, Y) > -1) and
      //(TNextGrid6(Sender).GetLevel(TNextGrid6(Sender).TNxReportGridView6(ActiveView).GetItemAtPos(X, Y))
     // = Wizard.RowLevelBeingDragged) then
      Accept := True
    else
      Accept := FALSE;


#80 BelangerC

BelangerC

    Senior Member

  • Members
  • PipPip
  • 221 posts
  • Location:Richmond, CA USA
  • Interests:Alternative medicine, programming for

Posted 06 July 2018 - 10:01 AM

Hi, Boki:

 

There is a missing parameter in OnVerticalScroll: Position. Anyway to get this back or an alternative? Thank you.

 

This is how I use if for this particular grid that I am trying to convert to NG6:

 

WITH Grid DO
  BEGIN
    // if using scroll bar, it can go past the last row index causing a list
    // index out of bounds
    IF (Position > RowCount - 1) OR (Position < 0) THEN
    BEGIN
      // 5/23/09
      // 2/27/13 just exit without message
      // DoFPShowMessage('You have scrolled past the grid row limits: ' + IntToStr(position), 2000);
      // ShowMessage(IntToStr(position));
      exit;
    END;
    Repaint; // needed for XE2 paint problems
  END;





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users