Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Message from the system.
Re: Message from the system. [message #27125 is a reply to message #27121] Sun, 27 June 2010 07:39 Go to previous messageGo to previous message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

281264 wrote on Sun, 27 June 2010 00:07

Hi,

I am attaching the files of the application in question (please remember that the purpose is to get familiar with U++). The application is very simple: open a dialog by clicking the button in the TopWindow; then type two (double) values in the Edit Fields; then press OK button , close dialog and then compute the multiplication and then show the outcome in the EditField in the TopWindow.


I'll try to help.
It is important that the chosen path (sequence of actions to create the program) is important!
Quote:


The idea is to practice with dialogs: how to create them, how to transfer values to the TopWindow, etc.

You will see that I still have no idea about how to position the widgets in the dialog, therefore the layout in the dialog is rubbish.


You must use the Layout Designer better.
Quote:




Taking advantage of your help, please allow me to ask some questions:

1.- How to pass the values from the EditFields in the dialog to the TopWindow; so far I have declared public the variables in the dialog so they can be accessed;


-To pass from program variable to dialog variable use this construction:
dialog_var <<= program_var;

-To get from dialog variable to program variable use this:
program_var = ~dialog_var;

Quote:


2.- How a string captured by a EditField can be converted to a numerical value (let us say double) and vice versa;


You must use Convert classes as ConvInt or simple use EditInt (what is the same).
Quote:


3.- How a dialog can be “closed” without having problems with the memoey? For example how is guaranteed that the dialog is deleted.


dialog is stack variable, because it's deleted automatically
Quote:


4.- In the manual I have seen expressions of this kind:
virtual Value Scan(const Value& text) const


Here, I just can not say. I do not use it.
Quote:


4.1.- What is the role of the “virtual” qualifier? I have seen that virtual functions are specially made for been overridden.


Yes, overriden member is variant to action with Ctrl.
Quote:


4.2.- Why the argument is a &?


It's easy. Passing parameters not by value, but on reference. This technique simply allows the function to direct modify the value of the parameter variable.
Quote:


4.3.- Any other suggestion related with "good" practices when programming.


practice for this task (My experiment with ScreenCasting):
http://ultimatepp.svsoft.ru/for-javier.html
PS
Sorry for my English


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Usage of "new" and "delete" in U++
Next Topic: Problems when using layouts
Goto Forum:
  


Current Time: Mon Apr 28 12:27:30 CEST 2025

Total time taken to generate the page: 0.00651 seconds