CAknForm CBA buttons

Login to reply to this topic.
Mon, 2006-02-20 18:28
Joined: 2004-08-19
Forum posts: 112
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,
Gábor


Tue, 2006-02-21 06:52
Forum Nokia Champion
Joined: 2004-05-26
Forum posts: 732
Re: CAknForm CBA buttons
Here is one thread with a similar kind of problem: How to change text of CBA buttons

Wed, 2006-02-22 18:28
Joined: 2004-08-19
Forum posts: 112
Re: CAknForm CBA buttons
No, it's not really similar. Unlike in that other topic, I have no problem with changing the button labels during normal conditions, I do it in other places in my application, too. I have a specific problem with the edit mode of CAknForm. Symbian handles the change to the edit mode automatically and doesn't seem to notify me of the mode change, so I don't know when to change the button labels. On the way back it's already simpler because SaveFormDataL() is called and that offers me an opportunity to change the labels back.

Bye,
Gábor

Thu, 2006-02-23 04:45
Forum Nokia Champion
Joined: 2004-05-26
Forum posts: 732
Re: CAknForm CBA buttons
Quote from: djgtram
I have a specific problem with the edit mode of CAknForm.

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.

 Huh

Thu, 2006-02-23 11:47
Joined: 2004-08-19
Forum posts: 112
Re: CAknForm CBA buttons
I already solved half of it...

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

  • Login to reply to this topic.