[Gambas-user] More on properties ...

Gareth Bult gareth at ...1689...
Tue May 1 14:51:47 CEST 2007


Just tidying .. will release later today ...

On Tue, 2007-05-01 at 14:41 +0200, Fabien Bodard wrote:

> hargg did you want to share this piece of code ?.... i will reduce my time
> on coding a lot :)
> 
> Fabien
> 
> PS: it remember me the multiple component on vb too
> 
> About this ... Benoit ?,
> is there a way to store a private component in other place than the gb
> compiler place . I mean in the user space. Does the ide will manage it. Have
> you thinked about the components namespace ?  (i know the problem of classe
> inheritance but at term it will be some confict on class names)
> 
> 
> 2007/5/1, Gareth Bult <gareth at ...1689...>:
> >
> > > I'm eager to see your DBGridEdit!
> >
> >
> > Ok, you said it ...  ;-)
> >
> > This is a working screenshot .. bar the ability to render the component
> > in design mode (and other IDE tweaks that would be nice) it's ready to
> > be played with ...
> >
> >
> >
> > I have FMain, with a tabstrip, and onto that tabstrip I've dropped a
> > DBConnection and a DBGridEdit .. and I have the following code ...
> >
> > PUBLIC SUB Form_Open()
> >
> >   grid.Open
> >
> > END
> >
> > The rest is set into the component's design time properties .. Cool eh!
> >
> > Features (as shown);
> >
> > o Changes are "marked" until you "commit" the table
> > o Row deletions are in red (toolbar button or "Del") with a red cross
> > icon
> > o Row insertions are marked with a "+" Icon
> > o rows with changes are marked with the scissors icon
> > o actual changes are marked as red on white
> > o different fields have different editor types, current textedit, combo
> > or textarea (checkbox coming soon)
> > o cursor keys give spreadsheet effect. enter or space or double click
> > gives appropriate editor
> > o buttons shown are "defaults" and auto-linked to the editor
> > o properties include fields containing columns to display, titles,
> > column widths etc
> > o properties also include appropriate SELECT,DELETE,UPDATE and INSERT
> > commands
> > o sample shows an edit session of my DNS zone file (which supplies live
> > DNS via Bind9 + DLZ patches
> > o note that in-line changes (add/edit/delete) do not require complete
> > refreshes, hence the in-line markup
> > o save or cancel commits or rolls back changes clearing all on-screen
> > markup
> >
> > And I even included the odd comment ... :)
> >
> > Todo;
> >
> > o Additional buttons "Filter","Sort ASC", "Sort DESC"
> > o Byline in the toolbar showing the current record count
> > o Property to turn the toolbar on/off
> > o A little work on better combo box management re; list contents
> > o Some other properties, for example the right hand column is always
> > resized (if possible) to the max for the window, this may not always be
> > desirable
> > o Some documentation, a download and a couple of sample apps
> >
> > :)
> >
> > Gareth.
> >
> >
> > On Sun, 2007-04-29 at 23:58 +0200, Benoit Minisini wrote:
> >
> > > On dimanche 29 avril 2007, Gareth Bult wrote:
> > > > Ok,
> > > >
> > > > What I'm doing for now is to have a string property in my DBGridEdit
> > > > called "DBConnection".
> > > > This is the "name" of a component type "DBConnection", which I use to
> > > > "wrap" a raw "Connection".
> > > > Logic: "Connections" do not type things timeouts and disconnects,
> > which
> > > > are common, esp. over the Internet.
> > > >
> > > > I have a method called Exec;
> > > >
> > > > PUBLIC SUB Exec(cmd AS String) AS Result
> > > >
> > > >   RETURN $conn.Exec(cmd)
> > > >
> > > >   CATCH
> > > >     Connect()
> > > >     RETURN $conn.Exec(cmd)
> > > > END
> > > >
> > > > Where Connect is;
> > > >
> > > > PRIVATE SUB Connect()
> > > >
> > > >   WITH $conn
> > > >
> > > >     .host = $host
> > > >     .type = $type
> > > >     .user = $user
> > > >     .Password = $pass
> > > >
> > > >   END WITH
> > > >
> > > >   TRY $conn.Close
> > > >   $conn.Open
> > > >
> > > > END
> > > >
> > > > This transparently handles reconnection in the event that a connection
> > > > has timed out .. which catches / fixes 99% of all my sql errors :-)
> > > >
> > > > Effectively I have a DBGridEdit component that subclasses my GridEdit
> > > > component, but includes a connection and sql statements .. so I can
> > > > pretty much get 98% of my code into DBGridEdit's property boxes at
> > > > design time .. so effectively I plonk a DBGridEdit onto a tab strip,
> > set
> > > > myDBGridEdit.Criteria to the "where" component of a query, then do
> > > > myDBGridEdit.Open and I'm off.
> > > >
> > > > The GridEdit handles all keystrokes etc etc nicely .. and the
> > DBGridEdit
> > > > tracks changes, handles the editor and writes stuff back to the DB
> > > > transparently.
> > > >
> > > > Reduces many days (or even weeks) of coding to (literally) minutes for
> > > > anything that needs to edit a DB on a grid.
> > > >
> > > > I've also included an integral button bar .. indeed I've been trying
> > to
> > > > write a component that will allow me to mimick "Navicat"'s DB editor,
> > > > but with a more modern feel .. hopefully it will make a rather nice
> > drop
> > > > in replacement for the Gambas Database manager's data editor ... :-)
> > > >
> > > > Anyway, another day or two so and I should have something to show
> > > > off ... ;-)
> > > > (but it would be really nice to get the extensions in place to handle
> > > > user/gambas-written components "fully" .. there are LOTS of historical
> > > > components knocking around from Kylix days that would be easy to
> > > > re-implement in Gambas .. I've already re-written an SMTP server
> > module
> > > > which is archiving all my incoming email into an SQL db... currently ~
> > > > 10,000 emails without a crash :-))
> > > >
> > > > Gareth.
> > > >
> > >
> > > I'm eager to see your DBGridEdit!
> > >
> >
> > --
> > Gareth Bult, Encryptec Limited
> > Tel: 0845 25 77033, FWD: 753977, Mob: 07891 389657
> > Email: gareth at ...1689..., MSN:garethbult at ...67...
> >
> > Statements made are at all times subject to Encryptec's Terms and
> > Conditions of Business, which are available upon request.
> >
> >
> >
> >
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by DB2 Express
> > Download DB2 Express C - the FREE version of DB2 express and take
> > control of your XML. No limits. Just data. Click to get it now.
> > http://sourceforge.net/powerbar/db2/
> > _______________________________________________
> > Gambas-user mailing list
> > Gambas-user at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
> >
> >
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user

-- 
Gareth Bult, Encryptec Limited
Tel: 0845 25 77033, FWD: 753977, Mob: 07891 389657
Email: gareth at ...1689... 
Statements made are at all times subject to Encryptec's Terms and Conditions of Business, which are available upon request.





More information about the User mailing list