You need to implement your own class , derive from CAknTextQueryDialog and override UpdateLeftSoftKeyL - then from inside UpdateLeftSoftKeyL call MakeLeftSoftkeyVisible.
e.g. /** CCustomeDialog is Derived From CAknTextQueryDialog */
Okay I got it working (kinda). Now onto a new dillema -- when I press okay when there is no text in the box, instead of just having the TBUF (notes) set to "", it also likes to crash (no panics or anything, just a plain ol' "program closed" message box). Do I have to override another function to handle the event of an empty String? I'm going to try that, but if there is a different/better way to do this, I'd be most appreciative .
Edit: I've discovered the cause of the crash by commenting out code, I think it is either the line that executes my custom CAknTextQueryDialog, or the construction line. Here is my source commented out:
Code:
/** Function that creates the dialog*/ TBuf<KMaxNotesLength> notes; CCustDBQueryDialog* notesQuery = CCustDBQueryDialog::NewL(notes);
if( notesQuery->ExecuteLD(R_CUSTDB_NOTES_BOX) ) { //Commented out stuff }
Forum posts: 111
Hi aarnott,
You need to implement your own class ,
derive from CAknTextQueryDialog and override UpdateLeftSoftKeyL - then from inside UpdateLeftSoftKeyL call MakeLeftSoftkeyVisible.
e.g.
/** CCustomeDialog is Derived From CAknTextQueryDialog */
void CCustomeDialog:: UpdateLeftSoftKeyL ()
{
MakeLeftSoftkeyVisible (ETrue);
}
All the best.
DipakBaviskar
Forum posts: 32
Here is my code (more like a template attempt):
#include <AknQueryDialog.h>
#include "custdbQueryDialog.h"
CCustDBQueryDialog* CCustDBQueryDialog::NewL(TDes& aText) {
//CCustDBQueryDialog* self = new CCustDBQueryDialog(aText);
CCustDBQueryDialog* self = (CCustDBQueryDialog*) CAknTextQueryDialog::NewL(aText);
self->MakeLeftSoftkeyVisible(ETrue);
CleanupStack::PushL(self);
return self;
}
void CCustDBQueryDialog::UpdateLeftSoftKeyL () {
MakeLeftSoftkeyVisible (ETrue);
}
//custDBQueryDialog.h
#ifndef CUSTDBQUERYDIALOG_H
#define CUSTDBQUERYDIALOG_H
#include <AknQueryDialog.h>
class CCustDBQueryDialog : public CAknTextQueryDialog {
public: // Constructor
static CCustDBQueryDialog* NewL(TDes& aText);
public: // from CAknTextQueryDialog
void UpdateLeftSoftKeyL ();
};
#endif
Sigh, if only Symbian were in java programming would be so much easier (I'm pretty bad with c++ as you can see...)
A.Arnott
Forum posts: 32
Edit: I've discovered the cause of the crash by commenting out code, I think it is either the line that executes my custom CAknTextQueryDialog, or the construction line.
Here is my source commented out:
/** Function that creates the dialog*/
TBuf<KMaxNotesLength> notes;
CCustDBQueryDialog* notesQuery = CCustDBQueryDialog::NewL(notes);
if( notesQuery->ExecuteLD(R_CUSTDB_NOTES_BOX) ) {
//Commented out stuff
}
/**CCustDBQueryDialog.h*/
#ifndef CUSTDBQUERYDIALOG_H
#define CUSTDBQUERYDIALOG_H
#include <AknQueryDialog.h>
class CCustDBQueryDialog : public CAknTextQueryDialog {
public: // Constructor
static CCustDBQueryDialog* NewL(TDes& aText);
private: // Constructor
CCustDBQueryDialog(TDes& aText) : CAknTextQueryDialog(aText) {};
public: // from CAknTextQueryDialog
void UpdateLeftSoftKeyL ();
};
#endif
/**CCustDBQueryDialog.cpp*/
#include <AknQueryDialog.h>
#include "custdbQueryDialog.h"
CCustDBQueryDialog* CCustDBQueryDialog::NewL(TDes& aText) {
CCustDBQueryDialog* self = new CCustDBQueryDialog(aText);
CleanupStack::PushL(self);
return self;
}
void CCustDBQueryDialog::UpdateLeftSoftKeyL () {
MakeLeftSoftkeyVisible (ETrue);
}
Thanks!
A.Arnott