2 * Copyright 2008-2010, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
6 * Michael Pfeiffer <laplace@users.sourceforge.net>
10 #include "WizardController.h"
12 #include "WizardView.h"
13 #include "WizardPageView.h"
17 WizardController::StateStack::MakeEmpty()
19 StateStack
* stack
= this;
25 } while (next
!= NULL
);
29 WizardController::WizardController()
36 WizardController::~WizardController()
46 WizardController::Initialize(WizardView
* view
)
49 _PushState(InitialState());
55 WizardController::Next(WizardView
* wizard
)
57 wizard
->PageCompleted();
62 int state
= NextState(fStack
->State());
72 WizardController::Previous(WizardView
* wizard
)
74 wizard
->PageCompleted();
77 StateStack
* stack
= fStack
;
78 fStack
= fStack
->Next();
86 WizardController::CurrentState() const
91 return fStack
->State();
96 WizardController::_PushState(int32 state
)
98 fStack
= new StateStack(state
, fStack
);
103 WizardController::_ShowPage(WizardView
* wizard
)
108 WizardPageView
* page
= CreatePage(fStack
->State(), wizard
);
109 wizard
->SetPage(page
);