Languages

Menu
Sites
Language
Simple app with two forms

Hi all
I want to create simple app with two forms (app will allow switch between them, using button on each form, for example). App should contain these classes only:  root frame and two forms(to be maximum simple).

There are known way how to create App based on scene manager:
Template->Form-Based App-> With SceneManager. In this case forms are created with 'FormFactory' class and placed on differen scenes , switching could be done using pSceneManager->GoForward(SceneTransitionId). And all logic could comfortably realized with Native UI builder-> workflow.

Is there more simple way for my case or to use SceneManager is preferable?

Thank you in advance.
Alexey.

Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

7 Replies
muditha murthy
I guess you can try naming each of the forms and use SetCurrentForm(..) API to switch between forms if you want it to be simple.
Alex Dem
almost. I have created empty app, I have created 2 forms with appropriate classes using UI Builder (with buttons to switch between forms) . I have created first form in MyAppFrame::OnInitializing and set it using ... AddControl(pForm1);SetCurrentForm(pForm1); etc but I unable to use SetCurrentForm method inside my forms classes . SetCurrentForm is Frame control method. I try to find simple way to initiate Form2 creation and do SetCurrentForm(pForm2) on button click on Form1, Form1::OnActionPerformed{}. Now way with sceneManager using is clear but maybe there are other ways? It is just interesting for me. Alexey.
youngsik yoon
use GetParent() to get the pointer of Frame class inside your Form. and then call the function of Frame class that would call SetCurrentForm(). by the way, i think you should use Panel. it's more simple way than using 2 Forms.
eunjin chun

Do you know how to make this function (with buttons to switch between forms) without UI Builder?

 

Alex Dem
Thank you for info! I will try to use proposed solutions. Alexey,
Ben Delv
Hi! I use this post to continue the subject with 2 others questions: 1) Is there only these two ways to make transition between the forms? As I understand, it is impossible to parametrize the Form construction using a Scenemanager. For example, the first form is a list of News and the second is the news details. The second form needs the News Object inside his constructor. Using SetCurrentForm it is easy. But with the SceneManager, it seems impossible to achieve since the signature of the method cannot provide an object parameter: Tizen::Ui::Controls::Form* FormFactory::CreateFormN(const Tizen::Base::String& formId, const Tizen::Ui::Scenes::SceneId& sceneId){...} 2) Am I wrong, and can we construct the form with parameters using SceneManager ?
Kamil N

hi,

 

You can send parameters into the Form using SceneManager. 

result Tizen::Ui::Scenes::SceneManager::GoForward    (	const SceneTransitionId & 	transitionId,
const Tizen::Base::Collection::IList * 	pArgs = null 
)

Put all parameters into list and read in in the form using OnSceneActivaded. See examples on API reference for more details.

 

Kamil