Jump to content


Photo

NextGrid5 -> NextGrid6 upgrade


  • Please log in to reply
31 replies to this topic

#21 BelangerC

BelangerC
  • Members
  • 112 posts
  • Location:Richmond, CA USA
  • Interests:Alternative medicine, programming for

Posted 02 October 2017 - 09:55 PM

Hi, Boki:

 

Yes, it may be helpful and easier to have a helper property FirstChild. Thank you.

 

Here are some settings I could not find in NG6, from NG5 Grid,AppearanceOptions, Grid.Options:

 

*ao3DGridLines = ?
*aoAlphaBlendedSelection = ActiveView.SelectionStyle := stAlphaBlended;
*aoBoldTextSelection = ?
*aoIndicateSelectedCell = ?

 

Can you confirm my guesses?

 

*goGrid = ActiveView.GridLines?

*goHeader = ActiveView.ShowHeader?
*goIndicator = ActiveView.ShowIndicator?
*goFooter = ActiveView.ShowFooter?
*goMultiSelect = ?
*goRowResizing = ActiveView.RowResizing := True;
*goRowMoving = ActiveView.RowMoving := True;
*goSelectFullRow = ?

 

BTW, what is ActiveView.ShowInsertRow mean/do?

 

Thank you, again. I am getting closer to being done. 

Chuck



#22 BelangerC

BelangerC
  • Members
  • 112 posts
  • Location:Richmond, CA USA
  • Interests:Alternative medicine, programming for

Posted 03 October 2017 - 03:21 AM

Grid.GridSpace

 

Hi, Boki:

Here is some code I have been using with an undocumented property in NextGrid5. How do I get the same information now?

 

FOR i := 0 TO MainForm.gridSelectNMTPaths.Columns.Count - 1 DO
  BEGIN
    IF MainForm.gridSelectNMTPaths.Columns[i].Visible THEN
    BEGIN
      ScanColWidth := ScanColWidth + MainForm.gridSelectNMTPaths.
        Columns[i].Width;
      GridLinesWidth := GridLinesWidth +
      // need the cast, since the prop conflicts with TLabelPosition
      // GridSpace is not documented, but is the space in pixels for the
      // grid lines used in the grid: lpLeft, lpRight, lpBottom, lpTop
        MainForm.gridSelectNMTPaths.GridSpace[TGridLinePosition(lpLeft)] +
        MainForm.gridSelectNMTPaths.GridSpace[TGridLinePosition(lpRight)];
    END;
 
Thank you!
Chuck


#23 BelangerC

BelangerC
  • Members
  • 112 posts
  • Location:Richmond, CA USA
  • Interests:Alternative medicine, programming for

Posted 03 October 2017 - 08:31 AM

TNxMemoInplaceEdit, TNxToolSeparator, TNxSpinButtonSet = Cannot find these in NG6

 

Grid.ReadOnly = ? NG6

Grid.VisibleRows = ? NG6

 

Thank you, Boki! I am real close now.

Chuck



#24 BelangerC

BelangerC
  • Members
  • 112 posts
  • Location:Richmond, CA USA
  • Interests:Alternative medicine, programming for

Posted 06 October 2017 - 01:12 AM

FYI:

NxNumberColumn.Increment for NxNumberColumn6 is "Incrememnt" I am guessing a misspelling.

Chuck



#25 BelangerC

BelangerC
  • Members
  • 112 posts
  • Location:Richmond, CA USA
  • Interests:Alternative medicine, programming for

Posted 06 October 2017 - 10:09 AM

Hi, Boki:

 

How do you use Columns.OnSetCell to replace Grid.OnCellFormating for changing the Font properties which are not equally available to all columns?

 

for instance I am currently (NG5) doing this in the generic routine called by the OnCellFormating event:

 

IF (SelectedRow = aRow) AND (SelectedCol = ACol) then
      // this works with SelectFullRow option
      BEGIN
        TextColor := clBlack;
        FontStyle := [fsBold];
      END
    end
    else
    begin
//otherwise keep the current color/style scheme
      TextColor := Columns[ACol].Font.Color;
      FontStyle := Columns[ACol].Font.Style;
    end;
 
Thank you,
Chuck


#26 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 7,564 posts
  • Gender:Male

Posted 06 October 2017 - 11:32 PM

Hi,

Sorry for delay,

If you want you can access Cell's properties such as Font.

Or, inside OnSetCell event you can set Column's properties. For example Column.Font . This event is called just a moment before cell is painted so you can configure column before cell is being drawn.

But beside this options, I'm thinking about having back OnFormatCell (or similar).
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.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.

#27 BelangerC

BelangerC
  • Members
  • 112 posts
  • Location:Richmond, CA USA
  • Interests:Alternative medicine, programming for

Posted 07 October 2017 - 03:10 AM

Thanks, Boki:

 

When I tried in one of your NG6 Demos to use OnSetCell the Cell parameter does not have Font exposed for use.

The NextGrid61.Columns[ACol].Font is available.

It would be nice to have a Grid wide event, such as OnFormatCell that applies to all cells, otherwise we have to add that event to every column.

 

I made a mistake in how I called  NextGrid61.Columns[ACol].Font before and thus did not see Font available. I used  Columns(), not [ ].

 

Regarding my other posts:

I figured out the Grid options and confirmed them on my own.

The ApperanceOptions I am guessing are really not necessary any more. The 3dGridLines is probably only good with Aero which no longer exists in Win10.

The two *aoBoldTextSelection = ?

*aoIndicateSelectedCell = ?

Might be useful. What I am noticing is that grid and cells looks different in NG6, but it would be nice to be able to highlight all selected cells in some way.

 

Did you see?: FYI:

NxNumberColumn.Increment for NxNumberColumn6 is "Incrememnt" I am guessing a misspelling.

 

Grid.ReadOnly = ? NG6

Grid.VisibleRows = ? NG6

 

TNxMemoInplaceEdit, TNxToolSeparator, TNxSpinButtonSet = Cannot find these in NG6 What would be their functional replacements?

 

Do you have an equivalent property: GridSpace?

MainForm.gridSelectNMTPaths.GridSpace[TGridLinePosition(lpLeft)] +

        MainForm.gridSelectNMTPaths.GridSpace[TGridLinePosition(lpRight)];
 
BTW, what is ActiveView.ShowInsertRow mean/do?
 
The NG6 equivalent for:
OnHeaderDblClick = ?

OnCellHint = ?
OnChange = ?

 

I have more, but will post them separately. I going through each form's PAS and DFM making changes. 

 

Here's another: OnVerticalScroll in NG6 has the single param, Sender, while in NG5 has Position. That Position param is very handy. I have been using the code below to keep users from over scrolling in the grid:

 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
          exit;
    END;
    Repaint; // needed for XE2 paint problems
  END;

 

And another:

We have RowExists, but not ColumnExists. NG5 was Columns[].Exists, now nothing. Definitely need this! or its equivalent.

 

Thank you!

Chuck



#28 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 7,564 posts
  • Gender:Male

Posted 07 October 2017 - 09:49 AM

Hi,

Yes, you set column properties just before cell is being drawn. Only thing to remember is to return them back for next cell. For example if you set red font. But I agree that OnCellFormating would be better. I will add it in upcoming release.

I also added ReadOnly property for Grid.

Inside Column now you have more events (also OnHeaderClick and similar).

InvertSelection property is maybe what you need for Full row selection?

I will see what else we miss. I think most of them are easy to add.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.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.

#29 BelangerC

BelangerC
  • Members
  • 112 posts
  • Location:Richmond, CA USA
  • Interests:Alternative medicine, programming for

Posted 13 October 2017 - 03:03 AM

Hi, Boki:

 

Consider this post a summary of what events, properties and methods that I will need to be included in NextGrid6 or their functional equivalents so that I can compile my application as I move from using NextGrid5. My intent here is to make it easier for others following this series of posts, too.

 

Events: 

Below events are only the ones that I use and if a ? indicate that I need the NG6 replacement

 

OnHeaderDblClick = ?
OnCellHint = ?
OnChange = ?

OnApplyEditText = ?

OnEdit = ?
OnCustomDrawHeader = Col.OnDrawContent, OnDrawBackground? Boki, does either of these two replace the event?
OnHeaderClick = Column.OnHeaderClick? Col.OnHeaderButtonClick? Boki, which is the best replacement?
OnSelectCell = OnSelect
OnCellColoring = ActiveView.OnGetCellColor (different State param)
NxReportGridView61GetCellColor(Sender: TObject; ACol,  ARow: Integer; var CellColor: TColor; State: TNxCellPaintingState);

  TNxCellPaintingState = set of (csSelected, csFocused, csEmpty, csPressed)

OnEditText = ?
OnCellFormating = Columns.OnSetCell procedure TForm1.NxTreeColumn61SetCell(Sender: TObject; ACol, ARow: Integer;  Cell: INxBaseCell); THE PROBLEM IS THAT CELL does not have Font settings! Need to reference the Columns(ACol).Font Boki said he would replace the OnCellFormting event.
OnExpand = OnRowExpandedChange
OnColumnResize = Column.OnResize? Boki, is this the replacement?

OnBeforeEdit = OnBeforeEdit with the addition in NG6 of the param, Text.

OnBeforeSelect = OnBeforeSelect with the addition in NG6 of the params Key and Shift.

OnCellClick = OnCellClick with the addition of Button (mouse button)

OnVertical/HorizontalScroll = OnVertical/HorizontalScroll in NG6, but the param POSITION is missing. I use this param and need a replacement 

 

 

Property Settings:

TAppearanceOptions: as far as I can tell none of these exist in NG6; not sure they even apply to the newer looking grid. I have removed reference to these options in my application until what is available is more clear.

 

* = denotes the AO's that I actually use in NG5

 

*ao3DGridLines = ?

*aoAlphaBlendedSelection = ?
*aoBoldTextSelection = ?
aoDontFillCells = ?
aoHideFocus = ?
aoHideSelection = ?
aoHighlightSlideCells = ?
aoHintMarks = ?
*aoIndicateSelectedCell = ?
aoIndicateSortedColumn = ?

 

TGridOptions: for these options, all the ones that I use in NG5 are available in NG6. For my application to compile right now I do not need any of the missing options.

 

goArrowKeyExitEditing = ?

goCanHideColumn = ?,

goDisableColumnMoving =  ActiveView.ColumnMoving = false

goDisableKeys = ?

goEscClearEdit = ?

goFooter = ActiveView.ShowFooter 

goGrid = ActiveView.GridLines

goHeader = ActiveView.ShowHeader 

goIndicator = ActiveView.ShowIndicator 

goInput = ?

goLockFixedCols = ?

goMultiSelect = Grid.MultiSelect := Boolean;

goRowResizing = ActiveView.RowResizing

goRowMoving = ActiveView.RowMoving

goSecondClickEdit = ?

goSelectFullRow = Grid.SelectFullRow := Boolean;

goUseDefaultValues = ?

goInplaceEditEvents = ?

 

other options:

 

HeaderSize = ActiveView.HeaderHeight

RowSize = RowHeight

SelectionMoveDirection: no longer

HeaderStyle = hsVista,, hsAuto  DO NOT USE any longer

InnerWidth = ?

GridSpace = ?, Undocumented property in NG5, but something I use to find the exact size of a grid.

ReadOnly = ?

VisibleRows = ?

SelectedColumn = SelectedCol

 

Column.Options:  Now are set via property settings rather than via the set

ShowTextFitHint := boolean

MultiLine := boolean

Editing := boolean

EditorAutoSelect = AutoEditing Is this same Boki?

DefaultWidth = use Width instead

DefaultValue = in NumberCols is a number, not a text number in DFM

Increment in Number Col, does not exist it is now “Incrememnt” MISSPELLING 

ShowLines = True; for NxTreeColumn; this is not a publised property, but available as a property to set.

Progress.RoundedCorners: NO LONGER

 

Header options:

Header.Orientation = hoHorizontal, hoVertical now: orHorizontal, orVertical

 

WrapKind: this property is only in some columns which makes doing a generic Columns[x].Wrapkind := wkWordWrap impossible without knowing the column class in advance. Boki, can you fix this?

 

coEditing = Columns[x].Editing := Boolean
coCanClick = ?
coCanInput = ?
coPublicUsing = NA
coShowTextFitHint = Col.ShowTextFitHint = true
coCanSort = Col.Sorted ?
coEditorAutoSelect = Column.AutoEditing := Boolean
coAutoSize = Column.AutoSize = boolean
coSearchColumn = ?
coImageForIcon = ?
coFixedSize = col.FixedWidth
coDontHighlight = (number col)
Editor = InPlaceEdit ? Noticed that a CheckBox Column cannot use a nxCheckBox editor, why is that?

 

Methods:

Cell[].Clear =?
ApplyEditing =?
GetRowAtPos =?
GetColumnAtPos =?
GetColumnAtPos.VisibleIndex =?
IsTextFit =?
GetCellRect =?
GetCellTop =?
GetChildCount =?
GetParent = ?

FirstChild = Row(x).ChildRow(0), would be helpful to have FirstChild

RefreshRange =?

NoSelection (deselects rows) =?
RefreshColumn =?

SelectLastRow =?

MoveSelectionDown =?
MoveSelectionUp =?

GetNextSibling, GetPrevSibling = Row(SelectedRow).NextSibling;

FirstRow = TNxReportGridView6(ActiveView).FirstIndex or NxReportGridView61.FirstIndex

Expanded() = Row().Expanded

ScrollToRow() = ActiveView.ScrollToRow()
GetFirstChild(Arow) = Grid.Row().ChildRow(0) ; FirstChild would be nice
GetLastChild() = ?

Grid.GetLevel = Grid.Row(x).GetLevel

HasChildren(x) = Row(x).HasChildren

Expanded[x] = Row(x).Expanded

 

Miscellaneous:

 

TNxMemoInplaceEdit does not seem to exist in NG6

 

TNxToolBar6 is quite different from the NG5 equivalent:

TNxSeparator is now a property setting of each added Button to the ToolBar, the buttons do not have a OnClick event, rather the ToolBar has a OnButtonClick event with Index as a parameter. It is not clear, but I am assuming the Index refers to the button index. The problem is that that OnButtonClick does not seem to functioning at all.

 

Thank you, Boki for a great upgrade to NG5!



#30 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 7,564 posts
  • Gender:Male

Posted 13 October 2017 - 07:05 PM

I will continue updating one by one.

OnHeaderClick can be found in ActiveView.OnHeaderMouseDown . There you can also Button (for double click, right, left button) and also Col parameter.

For edit events, you can check this article:
http://developer.ber...=683&lang=en-us

This part of component was long over-due so I changed it a bit.

goInput is ShowInsertRow in GridView.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.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.

#31 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 7,564 posts
  • Gender:Male

Posted 13 October 2017 - 07:09 PM

Update: For moving selection you can use:

  NextGrid61.SelectFirst();
  NextGrid61.SelectLast();
  NextGrid61.MoveByRow();
  NextGrid61.MoveByColumn();
Most of them support TShiftState parameter so you can keep existing selection and move to next.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.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.

#32 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 7,564 posts
  • Gender:Male

Posted 13 October 2017 - 07:10 PM

HintIndicators are in:

AppearanceOptios -> aoHintIndicators

boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.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.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users