undo gets [newbye]
- claudio.driussi
- Posts: 18
- Joined: Fri Nov 11, 2005 4:46 pm
undo gets [newbye]
I'm not very skilled in fwppc and x/harbour at all.
The dummy question is:
It is a way to restore original values of all get and other
controls of a form?
Lurking on TGet class i seen undo method, but i need a
variable to call the instance, there are a way to collect
all gets from parent window?
And how to undo other controls?
If there are no easy way to do this, the solution as usual
is to copy data to edit in temporary array but i hope in
something better.
Best Regards
Claudio Driussi
The dummy question is:
It is a way to restore original values of all get and other
controls of a form?
Lurking on TGet class i seen undo method, but i need a
variable to call the instance, there are a way to collect
all gets from parent window?
And how to undo other controls?
If there are no easy way to do this, the solution as usual
is to copy data to edit in temporary array but i hope in
something better.
Best Regards
Claudio Driussi
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Claudio,
>
It is a way to restore original values of all get and other
controls of a form?
>
Try this:
> And how to undo other controls?
Once their initial values have changed there is no way to undo them. It may be just available for GETs, as they contain a Harbour standard GET (like Clipper) that accepts an UnDo() method.
>
If there are no easy way to do this, the solution as usual
is to copy data to edit in temporary array but i hope in
something better.
>
Yes, that may be the only solution for all controls
>
It is a way to restore original values of all get and other
controls of a form?
>
Try this:
Code: Select all
for n = 1 to Len( oWnd:aControls )
if oWnd:aControls[ n ]:ClassName == "TGET"
oWnd:aControls[ n ]:oGet:Undo()
oWnd:aControls[ n ]:Refresh()
endif
next
Once their initial values have changed there is no way to undo them. It may be just available for GETs, as they contain a Harbour standard GET (like Clipper) that accepts an UnDo() method.
>
If there are no easy way to do this, the solution as usual
is to copy data to edit in temporary array but i hope in
something better.
>
Yes, that may be the only solution for all controls
- claudio.driussi
- Posts: 18
- Joined: Fri Nov 11, 2005 4:46 pm
Try this:
very nice!
> And how to undo other controls?
Once their initial values have changed there is no way to undo them. It may be just available for GETs, as they contain a Harbour standard GET (like Clipper) that accepts an UnDo() method.
For now is enough, but keep in mind which will be useful to have a undo
method for oWin wich recognize the type of control and do the
relative undo.
This mean that the TControl ancestor need a var called Original and so
you need to modify the root of class tree, but may be worth for.
Many thanks
Claudio
Code: Select all
for n = 1 to Len( oWnd:aControls )
if oWnd:aControls[ n ]:ClassName == "TGET"
oWnd:aControls[ n ]:oGet:Undo()
oWnd:aControls[ n ]:Refresh()
endif
next
> And how to undo other controls?
Once their initial values have changed there is no way to undo them. It may be just available for GETs, as they contain a Harbour standard GET (like Clipper) that accepts an UnDo() method.
For now is enough, but keep in mind which will be useful to have a undo
method for oWin wich recognize the type of control and do the
relative undo.
This mean that the TControl ancestor need a var called Original and so
you need to modify the root of class tree, but may be worth for.
Many thanks
Claudio
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- claudio.driussi
- Posts: 18
- Joined: Fri Nov 11, 2005 4:46 pm
- Biel EA6DD
- Posts: 680
- Joined: Tue Feb 14, 2006 9:48 am
- Location: Mallorca
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- claudio.driussi
- Posts: 18
- Joined: Fri Nov 11, 2005 4:46 pm
I wonder, how you bind the field names to the object?Antonio Linares wrote: USE YourDbf
DATABASE oDbf
edit your fields using oDbf:FieldName
to save the register do oDbf:Save(). If canceled, do nothing
i found _obj* function, but you don't use them in your source code.
Sorry for boring you, but really, i'm not confident with Harbour,
the documentation is terrible.
Claudio
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: