ActiveX Grid Component in UI

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

ActiveX Grid Component in UI

Alex Peake-2
I am learning how to add an ActiveX Component (ComponenetOne
TrueOLEDBGrid70) to a "View"

I used the ActiveX Wizard and I get lots of classes and methods. Good!

Where do I find the "Events" -> in VB the grid fires events like
gridName_UnboundWriteData when it requires more data from the recordset.
What is the Dolphin world equivalent?

Thanks,

Alex


Reply | Threaded
Open this post in threaded view
|

Re: ActiveX Grid Component in UI

Mikael Svane
Alex,

You can find the events that a control fires if you open it in the ActiveX
Control Browser. The events are shown in the lower right corner of the
browser. I experimented with a few ActiveX controls in Dolphin 4.0 and wrote
a pattern that worked for the controls that I tried. I haven't tried the
pattern in Dolphin XP, but if you are interested, it is available at my
homepage http://svane.swiki.net

Best regards,
Mikael Svane

"Alex Peake" <alexpSPAM FREE@waybettersoftwareSPAM FREE.com> skrev i
meddelandet news:3fa07cbd$[hidden email]...

> I am learning how to add an ActiveX Component (ComponenetOne
> TrueOLEDBGrid70) to a "View"
>
> I used the ActiveX Wizard and I get lots of classes and methods. Good!
>
> Where do I find the "Events" -> in VB the grid fires events like
> gridName_UnboundWriteData when it requires more data from the recordset.
> What is the Dolphin world equivalent?
>
> Thanks,
>
> Alex
>
>


Reply | Threaded
Open this post in threaded view
|

Re: ActiveX Grid Component in UI

Alex Peake-2
Many thanks Mikael! After reading that I made much progress. (It is rather
strange that Dolphin knows about Events as much as Methods, yet does not
offer the same automatic generation option.)

I am still a little stuck, in that I am not sure how the "Model" part (in
this case an ADO Recordset or maybe an ODBC Recordset) gets hooked into the
"Presenter" -- like Ted Bracht's example of the ListModel. I can find no
sufficiently similar (to my challenge) examples.

Any help from the community would be appreciated.

Alex

"Mikael Svane" <[hidden email]> wrote in message
news:bns1dn$155rve$[hidden email]...
> Alex,
>
> You can find the events that a control fires if you open it in the ActiveX
> Control Browser. The events are shown in the lower right corner of the
> browser. I experimented with a few ActiveX controls in Dolphin 4.0 and
wrote

> a pattern that worked for the controls that I tried. I haven't tried the
> pattern in Dolphin XP, but if you are interested, it is available at my
> homepage http://svane.swiki.net
>
> Best regards,
> Mikael Svane
>
> "Alex Peake" <alexpSPAM FREE@waybettersoftwareSPAM FREE.com> skrev i
> meddelandet news:3fa07cbd$[hidden email]...
> > I am learning how to add an ActiveX Component (ComponenetOne
> > TrueOLEDBGrid70) to a "View"
> >
> > I used the ActiveX Wizard and I get lots of classes and methods. Good!
> >
> > Where do I find the "Events" -> in VB the grid fires events like
> > gridName_UnboundWriteData when it requires more data from the recordset.
> > What is the Dolphin world equivalent?
> >
> > Thanks,
> >
> > Alex
> >
> >
>
>


Reply | Threaded
Open this post in threaded view
|

Re: ActiveX Grid Component in UI

Christopher J. Demers
"Alex Peake" <alexpSPAM FREE@waybettersoftwareSPAM FREE.com> wrote in
message news:3fa1e704$[hidden email]...
> Many thanks Mikael! After reading that I made much progress. (It is rather
> strange that Dolphin knows about Events as much as Methods, yet does not
> offer the same automatic generation option.)
>
> I am still a little stuck, in that I am not sure how the "Model" part (in
> this case an ADO Recordset or maybe an ODBC Recordset) gets hooked into
the
> "Presenter" -- like Ted Bracht's example of the ListModel. I can find no
> sufficiently similar (to my challenge) examples.

I may have misunderstood, but I thought you were using some sort of an
automatically data-bound grid, i.e. you just pass it a reference to the ADO
Recordset and it binds to it.  If that is the case then I suppose you could
just set the datasource property directly just like in VB from the #model:
method.

If the above is not the case then I suppose you would need to duplicate
whatever your VB code does.  You may want to write your own presenter code
for the control to connect your model.

You might want to look at John Aspinal's free EditableListView
http://www.solutionsoft.co.uk/widgets/ , it might be a replacement for the
ActiveX grid you are using and it does things the "Dolphin way".

You may need some sort of wrapper for the ADO Recordset to get it to act
like a collection.  I don't think there is much built-in support for
connecting a UI directly to a database in Dolphin so you may have to create
some layers for that.

Hopefully some of these comments have been of use.  If you do find a good
way to directly use your DB in the Dolphin UI then I would like to encourage
you to post about it.  I expect this information would make it easier for
many people to more directly port many VB database programs to Dolphin
Smalltalk.

Chris


Reply | Threaded
Open this post in threaded view
|

Re: ActiveX Grid Component in UI

Alex Peake-2
Many thanks Chris.

The simple fact is that I do not really know what I am doing!

I am trying to learn the "Dolphin Idiom" and trying not to simply translate
the VB way of doing things into Dolphin.

I learn by example, and there appear to be few in my domain. The only
significant writing I can find is Ted Bracht's book, so I am trying to
follow that.

I do not know, for example, whether "the idiom" would have me wrap the ADO
Recordset. In VB I would have a "GridManager" to respond to grid events - of
needing the next page of data for example, or treating the edits. The
database stuff for that particular grid would be another class.

Anyway, I guess I will plug away and see what happens!

Alex

"Christopher J. Demers" <[hidden email]> wrote in
message news:bnuugf$16disa$[hidden email]...
> "Alex Peake" <alexpSPAM FREE@waybettersoftwareSPAM FREE.com> wrote in
> message news:3fa1e704$[hidden email]...
> > Many thanks Mikael! After reading that I made much progress. (It is
rather
> > strange that Dolphin knows about Events as much as Methods, yet does not
> > offer the same automatic generation option.)
> >
> > I am still a little stuck, in that I am not sure how the "Model" part
(in
> > this case an ADO Recordset or maybe an ODBC Recordset) gets hooked into
> the
> > "Presenter" -- like Ted Bracht's example of the ListModel. I can find no
> > sufficiently similar (to my challenge) examples.
>
> I may have misunderstood, but I thought you were using some sort of an
> automatically data-bound grid, i.e. you just pass it a reference to the
ADO
> Recordset and it binds to it.  If that is the case then I suppose you
could

> just set the datasource property directly just like in VB from the #model:
> method.
>
> If the above is not the case then I suppose you would need to duplicate
> whatever your VB code does.  You may want to write your own presenter code
> for the control to connect your model.
>
> You might want to look at John Aspinal's free EditableListView
> http://www.solutionsoft.co.uk/widgets/ , it might be a replacement for the
> ActiveX grid you are using and it does things the "Dolphin way".
>
> You may need some sort of wrapper for the ADO Recordset to get it to act
> like a collection.  I don't think there is much built-in support for
> connecting a UI directly to a database in Dolphin so you may have to
create
> some layers for that.
>
> Hopefully some of these comments have been of use.  If you do find a good
> way to directly use your DB in the Dolphin UI then I would like to
encourage
> you to post about it.  I expect this information would make it easier for
> many people to more directly port many VB database programs to Dolphin
> Smalltalk.
>
> Chris
>
>


Reply | Threaded
Open this post in threaded view
|

Re: ActiveX Grid Component in UI

Alex Peake-2
In reply to this post by Christopher J. Demers
Two questions come to mind as I learn:

1) Should I create a GridPresenter?
2) Should I create a GridModel (similar to ListModel)?

Would this be following the Dolphin Idiom, or am I just making it too hard?
Should I just use the native functionality of the ComponentOne TrueDBGrid
and the ADODB Recordset.

I think only experiance (of which I have little) can answer these? I would
like to launch off in at least a reasonable direction.

Thanks,

Alex

"Christopher J. Demers" <[hidden email]> wrote in
message news:bnuugf$16disa$[hidden email]...
> "Alex Peake" <alexpSPAM FREE@waybettersoftwareSPAM FREE.com> wrote in
> message news:3fa1e704$[hidden email]...
> > Many thanks Mikael! After reading that I made much progress. (It is
rather
> > strange that Dolphin knows about Events as much as Methods, yet does not
> > offer the same automatic generation option.)
> >
> > I am still a little stuck, in that I am not sure how the "Model" part
(in
> > this case an ADO Recordset or maybe an ODBC Recordset) gets hooked into
> the
> > "Presenter" -- like Ted Bracht's example of the ListModel. I can find no
> > sufficiently similar (to my challenge) examples.
>
> I may have misunderstood, but I thought you were using some sort of an
> automatically data-bound grid, i.e. you just pass it a reference to the
ADO
> Recordset and it binds to it.  If that is the case then I suppose you
could

> just set the datasource property directly just like in VB from the #model:
> method.
>
> If the above is not the case then I suppose you would need to duplicate
> whatever your VB code does.  You may want to write your own presenter code
> for the control to connect your model.
>
> You might want to look at John Aspinal's free EditableListView
> http://www.solutionsoft.co.uk/widgets/ , it might be a replacement for the
> ActiveX grid you are using and it does things the "Dolphin way".
>
> You may need some sort of wrapper for the ADO Recordset to get it to act
> like a collection.  I don't think there is much built-in support for
> connecting a UI directly to a database in Dolphin so you may have to
create
> some layers for that.
>
> Hopefully some of these comments have been of use.  If you do find a good
> way to directly use your DB in the Dolphin UI then I would like to
encourage
> you to post about it.  I expect this information would make it easier for
> many people to more directly port many VB database programs to Dolphin
> Smalltalk.
>
> Chris
>
>


Reply | Threaded
Open this post in threaded view
|

Re: ActiveX Grid Component in UI

Blair McGlashan
Alex

You wrote in message news:3fa45a35$[hidden email]...
> Two questions come to mind as I learn:
>
> 1) Should I create a GridPresenter?
> 2) Should I create a GridModel (similar to ListModel)?
>
> Would this be following the Dolphin Idiom, or am I just making it too
hard?

IMO that would be too hard, especially if you are just starting. This isn't
just an issue of being a neophyte Dolphin user, but comes down to avoiding
abstract/generic design & programming until you have made a couple of more
concrete exaxmples behind you.

> Should I just use the native functionality of the ComponentOne TrueDBGrid
> and the ADODB Recordset.

Yes, certainly to start with. It really is worthwhile following the XP
approach of just doing it and refactoring later if/when you see the
opportunity. One of the great beauties of Smalltalk is that it is
considerably easier to redesign and radically change your program than it is
in most other programming languages and environments. This is partly the
dynamically typed nature of the language, and partly the live environment,
both of which allow you to evolve a program in more manageable stages
without having to endure long periods of "programming with bonnet up" (as we
say, meaning when it isn't working, and you wonder whether it will ever work
again).

The other thing is that Active-X components often represent a complete MVP
triad in themselves, and so it may be best to just treat them as a
component.

> I think only experiance (of which I have little) can answer these? I would
> like to launch off in at least a reasonable direction.

You might like to read the following post which has some more specific
guidance:

http://groups.google.co.uk/groups?hl=en&lr=&ie=UTF-8&selm=9egjdq%242qmbp%241%40ID-50941.news.dfncis.de

And the thread:

http://groups.google.co.uk/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&frame=right&th=51569d863dbd5dc1&seekm=92cua5%246jde9%241%40ID-51722.news.dfncis.de#link1

BTW: I would recommend getting hold of Bill Schwab and Ian Bartholomew's
DSDN tool (http://analgesic.anest.ufl.edu/anest4/bills/DSDN_news.htm) and
downloading the newsgroup archives from Ian's site
(http://www.idb.me.uk/news.html). There is a great deal of useful
information in the archives. Try doing a search in there for AXControlSite.

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: ActiveX Grid Component in UI

Christopher J. Demers
In reply to this post by Alex Peake-2
"Alex Peake" <alexpSPAM FREE@waybettersoftwareSPAM FREE.com> wrote in
message news:3fa45a35$[hidden email]...
> Two questions come to mind as I learn:
>
> 1) Should I create a GridPresenter?
> 2) Should I create a GridModel (similar to ListModel)?
>
> Would this be following the Dolphin Idiom, or am I just making it too
hard?
> Should I just use the native functionality of the ComponentOne TrueDBGrid
> and the ADODB Recordset.
>
> I think only experiance (of which I have little) can answer these? I would
> like to launch off in at least a reasonable direction.

Consider that it is hard for me to offer good ideas since I am unfamiliar
with the program you are trying to make, however I will try.  It is often
best to do the simplest thing that could work.  It seems to me that if the
grid you are using can directly connect to the ADO recordset and it can
accomplish what you need then that would be the easiest way to go right now.
I am still not totally sure if that is what you did in VB or not (your
mention of a GridManager makes me suspect not), so you may have had reasons
for not doing that in VB, maybe those same reasons will carry over into
Dolphin, I don't know.

What I see as a bigger picture here is whether to connect the database
directly to the UI at all or use domain object wrappers that could interface
with the database.  In VB I expect that developers rarely use their own
objects.  In Smalltalk we almost always use our own objects to model a
problem.  If your project is a simple database project and you can easily do
everything you need in SQL then it may be fine to connect the db directly to
the UI.  In that case I expect that the program would be a fairly
straightforward translation of the VB program.  This may be fine for some
things.  However if your project is something more sophisticated that could
benefit from an object oriented design then it may be appropriate to develop
object wrappers for your database entities and that obviates the need for a
direct database UI.  It would be interesting to here other people opinions
on these issues.

It took me some time and experience to grasp the concept of MVP and start to
use it properly.  In a way you are starting with a potentially complex
problem.  It may be worth while making sure you have the basics
(TextPresenters, ListPresenters) down (if you don't already) before trying
to write your own Presenter or Model wrapper for the grid (if you do end up
doing that).  I think the GridManager you mention in VB sounds like a
Presenter to me in that it handles events from the grid control, perhaps
that could be an area to explore.  One point of caution is not to get
frustrated.  Gaining experience with MVP will take some time, but once you
have that experience you will be able to do some very cool things easily.

I do hope this is generally coherent as I am a bit feverish at the moment.

Chris