×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jul 2007
    Location
    Lodz, Poland
    Posts
    9

    CAknFloatingPointQueryDialog problems getting value

    Hi,
    I have a problem with getting TReal value from CAknFloatingPointQueryDialog. This is my code:
    .h:
    Code:
    #include <e32base.h>
    #include <aknform.h>
    #include <akndialog.h>
    #include <aknquerydialog.h>
    
    class CCFBudgetBudgetedDialog : public CAknFloatingPointQueryDialog {
    	private:
    		CCFBudgetBudgetedDialog(TReal& aNumber);
    		
    	public:
    		virtual ~CCFBudgetBudgetedDialog();
        
    	protected:
    		void PreLayoutDynInitL();
    		void PostLayoutDynInitL();
    		TBool OkToExitL(TInt aButtonId);
    		
    	public:
    		static TInt RunDlgLD();
    		
    	private:
    		TInt resourceOffset;
    };
    .cpp:
    Code:
    #include "CFBudgetBudgetedDialog.h"
    
    #include <cf_budget_budgeted_dialog.rsg>
    
    CCFBudgetBudgetedDialog::CCFBudgetBudgetedDialog(TReal& aNumber) : CAknFloatingPointQueryDialog(aNumber) {
    	resourceOffset = 0;
    	#ifdef _DEBUG 
    		resourceOffset = CCoeEnv::Static()->AddResourceFileL(_L("z:\\resource\\apps\\cf_budget_budgeted_dialog.RSC") );
    	#else
    		resourceOffset = CCoeEnv::Static()->AddResourceFileL(_L("\\resource\\apps\\cf_budget_budgeted_dialog.RSC") );
    	#endif
    }
    
    CCFBudgetBudgetedDialog::~CCFBudgetBudgetedDialog() {
    	if(resourceOffset != 0)
    		CCoeEnv::Static()->DeleteResourceFile(resourceOffset);
    }
    
    TBool CCFBudgetBudgetedDialog::OkToExitL(TInt aButtonId) {
    	if(EAknSoftkeyOk == aButtonId) {
    		CEikFloatingPointEditor* moneyEd = (CEikFloatingPointEditor*) Control(EGeneralQuery);
    		TReal val = moneyEd->Value();
    		val++;
    	}
    
    	return ETrue;
    }
    
    void CCFBudgetBudgetedDialog::PreLayoutDynInitL() {
    	CAknFloatingPointQueryDialog::PreLayoutDynInitL();
    	DrawNow();
    }
    
    void CCFBudgetBudgetedDialog::PostLayoutDynInitL() {
    	CAknFloatingPointQueryDialog::PostLayoutDynInitL();
    }
    
    TInt CCFBudgetBudgetedDialog::RunDlgLD() {
    	TReal val = 1.0;
    	CCFBudgetBudgetedDialog* dlg = new (ELeave) CCFBudgetBudgetedDialog(val);
    	//here or in the okToExit
    	TInt ret;
    	if(ret = dlg->ExecuteLD(R_BUDGETED_DIALOG)) {
    		val = dlg->Number();
    	}
    	
    	return ret;
    }
    .rss:
    Code:
    RESOURCE RSS_SIGNATURE { }
    
    RESOURCE TBUF 
    	{ 
    	buf = "BUBD"; 
    	}
    
    RESOURCE DIALOG r_budgeted_dialog
    	{
    	flags = EGeneralQueryFlags | EEikDialogFlagNotifyEsc | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
    	buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
    	items = 
    		{
    		DLG_LINE
    			{
    			type = EAknCtQuery;
    			id = EGeneralQuery;
    			control = AVKON_DATA_QUERY
    				{
    				layout = EFloatingPointLayout;
    				label = STRING_r_cf_budget_budgeted_dialog;
    				control = FLPTED 
    					{
    					maxlength = 18;
    			        min = 0;
    			        max = 100; //Poprawic!!!!!!
    					};
    				};
    			}
    		};
    	}
    In .cpp code you can see that i made few exeprmients trying to get appropriate value but with no result.

    What is wrong in my approach?
    Regards
    Andr3y

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: CAknFloatingPointQueryDialog problems getting value

    check http://wiki.forum.nokia.com/index.ph...Example_50.zip, and the property container from it, there is one working solution available.

Similar Threads

  1. Problems about maemo 4.0.1 SDK installation.
    By fgg_maemo in forum General Development Questions
    Replies: 3
    Last Post: 2008-10-07, 14:26
  2. Several problems with NMIT 4.1 MMS
    By jtalviva in forum General Messaging
    Replies: 0
    Last Post: 2006-03-10, 11:03
  3. Several problems with NMIT 4.1
    By jtalviva in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2006-03-10, 10:59
  4. general problems in 3410
    By fredgauchet in forum Mobile Java General
    Replies: 1
    Last Post: 2002-08-26, 14:38

Posting Permissions

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