|
|
User login
Feeds |
Problem with CAknIpFieldEditor drawing
|
|||||
| Tue, 2005-08-02 10:39 | |
|
Hi All,
I use CAknIpFieldEditor but I have a problem with drawing of this control ![]() I hava CCoeControl witch content CAknIpFieldEditor, but when it called CCoeControl ->Draw() , CAknIpFieldEditor isn't repainted! Here is my Code: CallWatcherHttpContainer* CallWatcherHttpContainer::NewL(const TRect& aRect) { CallWatcherHttpContainer* self = CallWatcherHttpContainer::NewLC(aRect); CleanupStack::Pop(self); return self; } CallWatcherHttpContainer* CallWatcherHttpContainer::NewLC(const TRect& aRect) { CallWatcherHttpContainer* self = new (ELeave) CallWatcherHttpContainer; CleanupStack::PushL(self); self->ConstructL(aRect); return self; } void CallWatcherHttpContainer::ConstructL(const TRect& aRect) { CreateWindowL(); SetRect(aRect); iGTextEdMobileNumber = new (ELeave) CEikGlobalTextEditor; iGTextEdMobileNumber->SetContainerWindowL(*this); iGTextEdMobileNumber->ConstructL(static_cast<CCoeControl*>(this), 1, 100, EAknEditorFlagDefault, EGulFontControlAll, EGulNoSymbolFonts); iGTextEdMobileNumber->SetExtent( TPoint(37, 40), TSize(100,20)); //iGTextEdMobileNumber->SetFocus(ETrue); TPoint top(20, 80); TInetAddr lowAdr; lowAdr.SetAddress(KInetAddrNone); TInetAddr highAdr; highAdr.SetAddress(KInetAddrAll); iIpEditor = CAknIpFieldEditor::NewL(lowAdr, highAdr, lowAdr); iIpEditor->SetContainerWindowL(*this); iIpEditor->SetExtent(top, TSize(100,20)); iIpEditor->SetFocus(ETrue); ActivateL(); } CallWatcherHttpContainer::CallWatcherHttpContainer() { // No implementation required } CallWatcherHttpContainer::~CallWatcherHttpContainer() { // No implementation required } void CallWatcherHttpContainer::Draw(const TRect& aRect) const { // Get the standard graphics context CWindowGc& gc = SystemGc(); TRect rect = Rect(); gc.Clear(rect); gc.SetBrushColor(KRgbGray); gc.SetBrushStyle(CGraphicsContext::ESolidBrush); gc.DrawRect(rect); iGTextEdMobileNumber->Draw(rect); //iIpEditor - how can I use Draw for this control } TKeyResponse CallWatcherHttpContainer::OfferKeyEventL( const TKeyEvent& aKeyEvent,TEventCode aType) { // only the key press, not the key up/down event if (aType == EEventKey) { if (iIpEditor->IsFocused()) { return iIpEditor->OfferKeyEventL(aKeyEvent, aType); } } // Return the default functionality return CCoeControl::OfferKeyEventL(aKeyEvent, aType); } TCoeInputCapabilities CallWatcherHttpContainer::InputCapabilities() const { // This class does not implement any 'unusual' input capabilities return TCoeInputCapabilities::ENone; } Thanks a lot ! |
|
Forum posts: 192
Forum posts: 34
CountComponentControl is 0!
How can I add this controls in to parent CCoeControl.
This is my .h file:
#include <coecntrl.h>
#include <eikedwin.h>
#include <eikrted.h>
#include <gulcolor.h>
#include <eiklabel.h>
#include <aknipfed.h>
#include "FileManager.h"
class CEikGlobalTextEditor;
class CAknIpFieldEditor;
class CallWatcherHttpContainer : public CCoeControl
{
public:
static CallWatcherHttpContainer* NewL(const TRect& aRect);
static CallWatcherHttpContainer* NewLC(const TRect& aRect);
~CallWatcherHttpContainer();
CallWatcherHttpContainer(void);
public: // from CCoeControl
void Draw(const TRect& aRect) const;
TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
TCoeInputCapabilities InputCapabilities() const;
CEikGlobalTextEditor* iGTextEdMobileNumber;
CAknIpFieldEditor* iIpEditor;
private:
void ConstructL(const TRect& aRect);
};
Thanks for replay
Forum posts: 34
I solved my problem
I was forget to override this 2 methods - CountConponentControls and ComponentControls
Thanks for right way!
Forum posts: 192
`Warning - while you were typing a new reply has been posted. You may wish to review your post.`
Forum posts: 34
New problem with this CAknIpFieldEditor
Now when I create control with such type, I lose the tabbar in my the parent form. I tab witch content CAknIpFieldEditor the form lose tabbar up.
Any suggestions ?
Forum posts: 192
Forum posts: 34
The problem is following:
I have one view (tabbar) and in to view there are 2 controls GlobalTextEdit and CAknIpFieldEditor. When I'm in state edit my tabbar hide. (whne i have active cursor the tabbar hide and there is input type instead it - abc, Abc, 123)
Forum posts: 192
try to add