CAknForm CBA buttons
| Mon, 2006-02-20 18:28 | |
|
Hello, although the Form example doesn't show this, the applications in the phone (eg. Contacts) change the right button from Back to Done while the form (CAknForm) is currently edited. What would be the proper way to implement this? I can change back from Done to Back in SaveFormDataL() and its counterpart but where could I set it in the first place? Bye, Gábor Bye, |
|






Forum posts: 732
Forum posts: 112
Bye,
Gábor
Forum posts: 732
A call to SetEditableL( ETrue ); will make sure that the form is in edit mode. More than that IsEditable() will return whether the form is an editable mode or not.
Forum posts: 112
SetEditable() is not really a solution because I need the usual view/edit form where the user can decide when to enter edit mode. But I could finally catch it in ProcessCommandL(), after calling the usual CAknForm::ProcessCommandL (command);, I can check whether the command was EAknFormCmdEdit and set the different labels there.
However, the problem remains where I didn't expect it to be: where to turn it back. QuerySaveChangesL() is OK if the user did modify anything but if they happen to bail out of edit mode without touching any of the data fields, this function is never called, so I get no chance to revert to the original button labels. I'm right now experimenting with the same approach I used to set the labels, but ProcessCommandL() is not called at all when I come out of edit mode. Strange.
I also tried to override SetEditableL() but it's not working, either. I could call it any time myself but, apparently, it's not used internally by the form when it changes modes.
Bye,
Gábor