Sunday, August 05, 2007

A color picker in Symbian S60 v3

TBool noneExist = EFalse;
TBool noneChosen = EFalse;
TRgb colour = KRgbDarkGray;

CArrayFixFlat<TRgb>* colours = new(ELeave) CArrayFixFlat<TRgb>(6);
colours->AppendL(KRgbBlack);
colours->AppendL(KRgbDarkGray);
colours->AppendL(KRgbRed);
colours->AppendL(KRgbSymbianOrange);
colours->AppendL(KRgbBlue);
colours->AppendL(KRgbWhite);
colours->AppendL(KRgbCyan);
colours->AppendL(KRgbYellow);
colours->AppendL(KRgbGreen);

CAknColourSelectionGrid *d = CAknColourSelectionGrid::NewL( colours, noneExist, noneChosen, colour);
if(d->ExecuteLD())
{
///Here you get the selected color..this you can use in your draw method.
//selectedColor = colour;

DrawNow();
}

No comments:

stats counter