×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    391

    Update a custom control in a AknDialog inherited Dialog failed?

    The dialog shows ok and wait for operate,but when calling drawnow in custom control's key handle fuction,there is nothing updated!The draw fuction in custom control is called correctly,but the show is just the same ,nothing updated?

    TKeyResponse CCustomDlg::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
    {
    if (HandleKeyEvents(aKeyEvent, aType))
    return EKeyWasConsumed;
    else if(iFocusedControl)
    return iFocusedControl->OfferKeyEventL(aKeyEvent, aType);
    else
    return EKeyWasNotConsumed;
    }


    TBool CSlider::HandleKeyEvents(const TKeyEvent& aKeyEvent, TEventCode aType)
    {
    if ((aType == EEventKey) && IsFocused())
    {
    switch(aKeyEvent.iCode)
    {
    case EKeyRightArrow:
    if(iVal<maxVal )
    {
    iVal+=iStep;
    TBuf<9> temp;
    temp.Num(iVal);
    valueLabel->SetTextL(temp);
    DrawNow();
    //ActivateL();
    }
    else
    iVal = maxVal;
    return ETrue;
    break;
    case EKeyLeftArrow:
    if(iVal>minVal)
    {
    iVal-=iStep;
    TBuf<9> temp;
    temp.Num(iVal);
    valueLabel->SetTextL(temp);
    DrawNow();
    // ActivateL();
    // Window().Invalidate();
    }
    else
    iVal = minVal;
    return ETrue;
    break;
    default:
    ;
    }
    }
    return EFalse;
    }

    void CSlider:raw(const TRect& aRect) const
    {
    if (!Rect().IsEmpty())
    {
    CWindowGc& gc=SystemGc();
    gc.SetClippingRect(aRect);
    gc.Reset();
    TSize sz(line->SizeInPixels());
    gc.BitBltMasked(bitRect.iTl+TPoint(0,
    (bitRect.Height()-sz.iHeight)/2),
    line,
    TRect(TPoint(0,0),TSize(bitRect.Width(),bitRect.Height()) ),
    line_m,
    ETrue);

    //draw drag icon
    TSize sz2(drag->SizeInPixels());
    TInt ix = (iVal-1)*(bitRect.Width()-sz2.iWidth) /(maxVal-1) ;//+ (bitRect.Width()-sz.iWidth)/2;
    TInt iy = (sz.iHeight - sz2.iHeight)/2 + (bitRect.Height()-sz.iHeight)/2;

    gc.BitBltMasked(bitRect.iTl+TPoint(ix,iy),
    drag,
    TRect(sz2),
    drag_m,
    ETrue);
    }
    }

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    391

    Re: Update a custom control in a AknDialog inherited Dialog failed?

    WaitForRequest() in RunLD hang up the draw message?

Similar Threads

  1. Replies: 2
    Last Post: 2007-07-24, 14:33
  2. custom control - clipping problem
    By boumitran in forum Symbian User Interface
    Replies: 0
    Last Post: 2006-05-17, 06:23
  3. yucca help, question about custom control in dialog
    By mobileworm in forum Symbian User Interface
    Replies: 0
    Last Post: 2005-10-05, 17:23
  4. Replies: 0
    Last Post: 2004-08-23, 15:28
  5. Custom control in Series 60 form
    By jandrhub in forum Symbian User Interface
    Replies: 3
    Last Post: 2004-03-09, 12:12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×