Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2019-10

DBNavigator: why is the refresh button enabled only if the dataset is modifiable?

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Luca Olivetti

In lcl/include/dbcustomnavigator.inc, method
TDBCustomNavigator.EditingChanged

CanModify:=Enabled and FDataLink.Active and FDataLink.DataSet.CanModify;
...
Buttons[nbRefresh].Enabled:=CanModify;

Why?

I mean, I have a read only query (specifically a TZReadOnlyQuery) since I only want to show the data, but another application can change it, hence a refresh could be needed.

Bye

Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007

Reply by email

Juha Manninen
to Luca Olivetti
PM Luca Olivetti wrote 6 lines
In lcl/include/dbcustomnavigator.inc, method TDBCustomNavigator.EditingChanged CanModify:=Enabled and FDataLink.Active and FDataLink.DataSet.CanModify; ... Buttons[nbRefresh].Enabled:=CanModify;

I don't know DBNavigator well. It has 2 sets of buttons, the "Buttons" and then "FocusableButtons". What are those?
The same TDBCustomNavigator.EditingChanged method also has:

  FocusableButtons[nbRefresh].Enabled:=Enabled and FDataLink.Active

and not FDataLink.Editing;
Maybe the same conditions would apply to Buttons[nbRefresh] as well.

Juha

Reply by email

Luca Olivetti
to Juha Manninen

El 16/10/19 a les 19:49, Juha Manninen via lazarus ha escrit:

Show quoted text 15 lines
On Wed, Oct 16, 2019 at 6:11 PM Luca Olivetti via lazarus wrote: > In lcl/include/dbcustomnavigator.inc, method > TDBCustomNavigator.EditingChanged > > CanModify:=Enabled and FDataLink.Active and FDataLink.DataSet.CanModify; > ... > Buttons[nbRefresh].Enabled:=CanModify; I don't know DBNavigator well. It has 2 sets of buttons, the "Buttons" and then "FocusableButtons". What are those? The same TDBCustomNavigator.EditingChanged method also has: FocusableButtons[nbRefresh].Enabled:=Enabled and FDataLink.Active and not FDataLink.Editing; Maybe the same conditions would apply to Buttons[nbRefresh] as well.

I don't know either, I just find it strange that the refresh button is disabled when it's most needed.
And even stranger that I didn't notice until today ;-) Or maybe I did and forgot about it :-D

Bye

Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007

Reply by email