Jump to content


Photo

DB aware versions


  • Please log in to reply
17 replies to this topic

#1 didiergm

didiergm
  • Honorable Members
  • 148 posts
  • Gender:Male
  • Location:France

Posted 31 July 2007 - 02:40 PM

Boki,

Do you have any plans for dataaware versions of your editors in the near future ?

Didier

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 31 July 2007 - 02:49 PM

Hello Didier,

I have in plan, but I don't think that it can be done in near future.

Best regards
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.

#3 didiergm

didiergm
  • Honorable Members
  • 148 posts
  • Gender:Male
  • Location:France

Posted 31 July 2007 - 02:52 PM

QUOTE (Boki (Berg) @ Jul 31 2007, 03:49 PM) <{POST_SNAPBACK}>
Hello Didier,

I have in plan, but I don't think that it can be done in near future.

Best regards


Ok, in that case I'll try and do some of them myself. May be you'll find them useful.

Didier

#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 31 July 2007 - 03:03 PM

Hello Didier,

If you got some results I will be happy to see them.

Biggest problem is because Delphi doesn't support multiple inheritance and that I will need to create new TNxDBCustomEdit and then inherit other DB editors again from this component sad.gif

Best regards
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.

#5 didiergm

didiergm
  • Honorable Members
  • 148 posts
  • Gender:Male
  • Location:France

Posted 31 July 2007 - 03:37 PM

May be I am being naive, but I would start from your components and "just" add the db_awareness layer.

I'll give it a go and let you know how this works

Didier

#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 31 July 2007 - 03:39 PM

Hello Didier,

You will need to add same procedures to every component then sad.gif You will need DataField property, DataSource and so on for DB-aware versions.

I will like to keep standard version separate from db-versions and this may be hard to archieve.

Best regards
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.

#7 didiergm

didiergm
  • Honorable Members
  • 148 posts
  • Gender:Male
  • Location:France

Posted 01 August 2007 - 09:27 PM

QUOTE (Boki (Berg) @ Jul 31 2007, 04:39 PM) <{POST_SNAPBACK}>
Hello Didier,

You will need to add same procedures to every component then sad.gif You will need DataField property, DataSource and so on for DB-aware versions.

I will like to keep standard version separate from db-versions and this may be hard to archieve.

Best regards

I gave it a go and seem to have a bit of a problem with updating the data once it's been entered, not sure why. I'll investigate more tomorrow but I might have to ask for some help. Would that be allright or are you too busy at present ?

Didier

#8 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 01 August 2007 - 09:44 PM

Hello Didier,

You may ask and I will try to help smile.gif

I suggest also that you check VCL source to see how their db-editors are made.

Best regards
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.

#9 didiergm

didiergm
  • Honorable Members
  • 148 posts
  • Gender:Male
  • Location:France

Posted 03 August 2007 - 11:38 AM

Boki,

I am making good progress with some components. One thing beats me though I can't figure out which event is fired when you click on an item in a tNxComboBox. it seems that I'll need to override that event to properly update the underlying field but find it difficult to follow. Can you point me in the right direction ?

Didier

#10 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 03 August 2007 - 03:31 PM

Hello Didier,

I am glad to hear this smile.gif I can't wait to see how it progress.

Maybe DoDropDownInput procedure is what you need. This procedure occur when you finish editing inside popup.

Best regards
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.

#11 didiergm

didiergm
  • Honorable Members
  • 148 posts
  • Gender:Male
  • Location:France

Posted 03 August 2007 - 09:14 PM

Boki,

I might have found a bug in tnxComboBox: Even if it is set to read Only, you can still change it's contents by selecting an item in the dropdown window.

That's blocking me to get a proper behavior in dbaware version. What do you reckon ?


I believe that
QUOTE
procedure TNxComboBox.DoDropDownInput(Sender: TObject; Value: string);
begin
{ note: first set ItemIndex then trigger
events (OnChange, OnCloseUp, OnSelect) }
ItemIndex := TNxPopupList(FPopupControl).ItemIndex;
inherited;
end;


Should become

QUOTE
procedure TNxComboBox.DoDropDownInput(Sender: TObject; Value: string);
begin
{ note: first set ItemIndex then trigger
events (OnChange, OnCloseUp, OnSelect) }
If Not Readonly then ItemIndex := TNxPopupList(FPopupControl).ItemIndex;
inherited;
end;


and that

QUOTE
procedure TNxCustomButtonEdit.ApplyInput(Value: string);
begin
Text := Value;
end;


Should become

QUOTE
procedure TNxCustomButtonEdit.ApplyInput(Value: string);
begin
If not ReadOnly then Text := Value;
end;



And finally should'nt

QUOTE
procedure TNxComboBox.ApplyInput(Value: string);
begin

end;


become

QUOTE
procedure TNxComboBox.ApplyInput(Value: string);
begin
inherited;
end;

?

I am not too sure about the last one, as I am getting confused between DsDropDown and dsDropDownList modes

Hope I am making sense

Didier

#12 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 04 August 2007 - 06:53 PM

Hello Didier,

I will check it today, and try to apply your changes and if they are fine, I will include them.

Thank you!

Best regards
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.

#13 didiergm

didiergm
  • Honorable Members
  • 148 posts
  • Gender:Male
  • Location:France

Posted 04 August 2007 - 07:51 PM

QUOTE (Boki (Berg) @ Aug 4 2007, 07:53 PM) <{POST_SNAPBACK}>
Hello Didier,

I will check it today, and try to apply your changes and if they are fine, I will include them.

Thank you!

Best regards

I am now running out of time (I have a prog to deliver on Monday morning, so need to stop playing around. I will resume work later. But probably changing a bit because the gRaph I made made me realise that by changing just tnxEdit I could have a host of object nearly completed in on swoop. ... tempting smile.gif

and I'll probably work with an interface instead of adding the obects directly (not too sure yet) this way I could have only one set of objects dbaware and non-dbaware ... something the VCL cannot provide. (try to use a tdbedit w/o specifying a datasource/datafield and you'll get my meaning. if

could avoid that ... would be fantastic. but that's for another day

Didier

#14 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 04 August 2007 - 09:05 PM

Hello Didier,

I was try to use interfaces for making Db-aware editors, but it may be anoying implementing same procedures for each new db-edit. Example:

TNxComboBox = class

TNxDBComboBox = class(TNxComboBox, IDBEdit);

This IDBEdit will need to have DataField and DataSource properties, and one TDataLink object need to be created too. It will be tricky definitelly, but it is possible.

Best regards
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.

#15 didiergm

didiergm
  • Honorable Members
  • 148 posts
  • Gender:Male
  • Location:France

Posted 04 August 2007 - 09:57 PM

QUOTE (Boki (Berg) @ Aug 4 2007, 10:05 PM) <{POST_SNAPBACK}>
Hello Didier,

I was try to use interfaces for making Db-aware editors, but it may be anoying implementing same procedures for each new db-edit. Example:

TNxComboBox = class

TNxDBComboBox = class(TNxComboBox, IDBEdit);

This IDBEdit will need to have DataField and DataSource properties, and one TDataLink object need to be created too. It will be tricky definitelly, but it is possible.

Best regards


I suppose you're right. That's definitely the drawback of interfaces. On the other hand it might allow constructs lile 'if not supports(idataaware) then behave like a normal nxEdit ... for example. I'll have a play asap.

Didier

#16 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 04 August 2007 - 10:00 PM

Hello Didier,

I have think about this too, about implementing DataField and DataSource into TNxCustomEdit and then simply publishe these properties for db-editors. But this also may give some problems sad.gif

Best regards
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.

#17 didiergm

didiergm
  • Honorable Members
  • 148 posts
  • Gender:Male
  • Location:France

Posted 04 August 2007 - 11:18 PM

QUOTE (Boki (Berg) @ Aug 4 2007, 11:00 PM) <{POST_SNAPBACK}>
Hello Didier,

I have think about this too, about implementing DataField and DataSource into TNxCustomEdit and then simply publishe these properties for db-editors. But this also may give some problems sad.gif

Best regards


Like what for example ?

I have a feeling that you would have to revisit some descendants. Am I right ?

Didier

#18 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 05 August 2007 - 12:34 AM

Hello Didier,

I have do this with NextInspector, every item already have FieldName. So far no problems with it.

But, I am allways aware that Borland/CodeGear will not include support for DB's (TField) in some versions of Delphi/BCB.

Best regards
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.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users