EdWin problem

Login to reply to this topic.
Tue, 2005-09-06 06:56
Joined: 2005-03-03
Forum posts: 56
Hi all,

How to dissable the special char dialog which come when you press alt key, in series 80?

I have a dialog which contains an edit window, which accepts ascii only, but this special char dialog comes up whenever i press alt key. But this dialog is deleted only if i press cancel in the command button area. This dialog doesn't seems to go off even if i delete my dialog.

Any clue on why this is and how to remove this behavior?

I tried capturing the alt key, but the capturing doesn't seem to work.

The problem with this is i am not able to create a new dialog or a new set of CBA's . If this special char dialog is active the CBA creation fails in
SetCommandSetL function.
////////////////////
CEikButtonGroupContainer* CBA;
CBA = CEikButtonGroupContainer::Current();
if(CBA)
{
User::After(30000);
TRAPD(err,CBA->SetCommandSetL(aResourceID)) //fails
if(err == KErrNone)
CBA->DrawNow();
}
///////////////

My edit win creation is as follows

iNew = new (ELeave) CEikEdwin();
iNew->ConstructL(CEikEdwin::ELineCursor|CEikEdwin::EAllowUndo|CEikEdwin::EOnlyASCIIChars,6,32,1);
iNew->SetContainerWindowL(*this);
iNew->SetObserver(this);
iNew->SetExtent(TPoint(100,20),iPwdNew->MinimumSize());
iNew->SetFocus(ETrue);

what could be the problem?

regards
arun




Tue, 2005-09-06 15:04
Joined: 2004-07-01
Forum posts: 13
Re: EdWin problem
Hi!

What is in your OfferKeyEventL function?

RadeaR
Wed, 2005-09-14 12:00
Joined: 2005-03-03
Forum posts: 56
Re: EdWin problem
TKeyResponse Container::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
{
if(aType!=EEventKey)
      return EKeyWasNotConsumed;
   if(aKeyEvent.iCode == EKeyEscape || aKeyEvent.iCode == EKeyEnter || aKeyEvent.iCode == EKeyTab ||\
      aKeyEvent.iCode == EStdKeyEscape || aKeyEvent.iCode == EStdKeyEnter || aKeyEvent.iCode == EStdKeyTab ||\
      aKeyEvent.iCode == EKeyRightArrow || aKeyEvent.iCode == EKeyLeftArrow ||aKeyEvent.iCode == EKeyUpArrow ||\
      aKeyEvent.iCode == EKeyDownArrow || aKeyEvent.iCode == EKeyLeftAlt || aKeyEvent.iCode == EKeyRightAlt ||\
      aKeyEvent.iCode == EKeyLeftCtrl || aKeyEvent.iCode == EKeyRightCtrl)
   {
      return EKeyWasConsumed;
   }
   //Capturing unnecessary keypress.
   TInt keyCode = aKeyEvent.iCode;
   if( (keyCode < 32  && keyCode!=8) || keyCode == 127)
   {
      return EKeyWasConsumed;
   }
   if(aKeyEvent.iCode == EKeyBackspace)
   {
      TInt len = iPwdBuf.Length() ;
      if(len != 0)
      {
         iPwdBuf.Delete(len-1,1);
      }
      iPwdEditor->OfferKeyEventL(aKeyEvent,aType);
      return EKeyWasConsumed;
   }
   iPwdEditor->OfferKeyEventL(aKeyEvent,aType);
   TInt len = iPwdEditor->TextLength();

   if(len <= 32 && len != 0)
   {
      TBuf<32> buffer1;
      TBuf<32> buffer2;
      buffer2.Zero();
      iPwdEditor->GetText(buffer1);
      TUint ascii = buffer1[len-1];
      if(len < 32)
      {
         iPwdBuf.Append(ascii);
      }
      for(TInt i=0; i<len; i++)
      {
         buffer2.Append(TChar('*'));
      }
      iPwdEditor->SetTextL(&buffer2);
      iPwdEditor->SetCursorPosL(len+1,EFalse);
   }
   return EKeyWasConsumed;
}
Tue, 2005-09-27 14:15
Joined: 2004-07-01
Forum posts: 13
Re: EdWin problem
Hi!

Pls add next flag to your EDWIN control in *.rss resource file:

       DLG_LINE
           {
            type    = EEikCtEdwin;
            prompt  = "Text:";
            id      = EMyText;
            control = EDWIN
         {
                        flags = EEikEdwinOnlyASCIIChars;  // <----this
         width = 25;
         lines = 1;
         };
      }

Good luck!

Regards,
RadeaR
Thu, 2006-02-02 09:04
Joined: 2005-03-03
Forum posts: 56
Re: EdWin problem
i changed the input capabilities of the enwin and could resolve this issue
  • Login to reply to this topic.