Buttons Created using Resources not displayed not displayed on device
hi all,
Strange issues seems to hav a affinity for me.
I have Created buttons using resources and it works fine in emulator. But on device the buttons are not displayed. It enters the the fn where i create buttons...but still the buttons r missing...
Here's how I create button :
[CODE]void Demo:CreateButtonUsingResource()
{
iNextButton = CAknButton::NewL();
iNextButton->ConstructFromResourceL(R_FIRST_BUTTON);
iNextButton->SetContainerWindowL(*this);
iNextButton->SetRect(TRect ( TPoint(530,310), TSize(30,20) ) );
iNextButton->SetObserver(this);
iNextButton->MakeVisible(ETrue);
iNextButton->ActivateL();
}
[/CODE]
Here's my resource file:
[CODE]
RESOURCE AVKON_BUTTON r_first_button
{
flags = KAknButtonNoFrame;
states =
{
AVKON_BUTTON_STATE
{
helptxt = "";
bmpfile = BUTTON_IMAGE;
bmpid = EMbmdemoNext;
bmpmask = EMbmdemoNext_mask;
},
AVKON_BUTTON_STATE
{
flags = KAknButtonStateHasLatchedFrame;
bmpfile = BUTTON_IMAGE;
bmpid = EMbmdemoNext;
bmpmask = EMbmdemoNext_mask;
}
};
}
[/CODE]
I understand that harcoding d SetRect values for button is not a bright idea....but can tht be d reason for not displaying it at all..i tried a couple of permutation-combination with the co-ordinates. Noting worked....
Ny thing tht I'm missing..???
aniticipating ny kind of clue,suggestions,help....i lost it again... :(
Re: Buttons Created using Resources not displayed not displayed on device
The buttons are visible when i do the default, but not otherwsie...i'm using the same mbm file i use for other icons which are visble but only the buttons dissapear....
RESOURCE AVKON_BUTTON r_first_button
{
flags = KAknButtonTextInsideFrame;
states =
{
AVKON_BUTTON_STATE
{
helptxt = "First";
bmpfile = AVKON_BITMAP_FILE;
bmpid = EMbmAvkonQgn_note_query;
bmpmask = EMbmAvkonQgn_note_query_mask;
},
AVKON_BUTTON_STATE
{
flags = KAknButtonStateHasLatchedFrame;
bmpfile = AVKON_BITMAP_FILE;
bmpid = EMbmAvkonQgn_note_query;
bmpmask = EMbmAvkonQgn_note_query_mask;
}
};
}
Plz help..i feel this is a trivial issue....nd i'm missing out sumthing silly...plz help...