Apply new AppResourceId policy
[apps/native/sample/BasicApp.git] / project / src / MainForm.cpp
index bd2dca6..5a898cb 100644 (file)
@@ -18,6 +18,7 @@
 #include <FApp.h>
 #include <FBase.h>
 
+#include "AppResourceId.h"
 #include "ButtonPanel.h"
 #include "ImagePanel.h"
 #include "MainForm.h"
@@ -45,7 +46,7 @@ MainForm::~MainForm(void)
 result
 MainForm::Initialize(int panelId)
 {
-       result r = Form::Construct(L"IDF_MAINFORM");
+       result r = Form::Construct(IDF_MAINFORM);
 
        if (panelId >= 0 && panelId <= 2)
        {
@@ -63,10 +64,12 @@ result
 MainForm::CreateImagePanel(void)
 {
        ImagePanel* pImagePanel = new (std::nothrow) ImagePanel();
-       pImagePanel->Initialize(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height));
+       result r = pImagePanel->Initialize(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height));
        AddOrientationEventListener(*pImagePanel);
-       AddControl(*pImagePanel);
+       r = AddControl(pImagePanel);
        __pPanel[2] = pImagePanel;
+
+       return r;
 }
 
 result
@@ -113,15 +116,15 @@ MainForm::OnInitializing(void)
        // Create the Button panel
        ButtonPanel* pButtonPanel = new (std::nothrow) ButtonPanel();
        pButtonPanel->Initialize(rect);
-       AddControl(*pButtonPanel);
+       AddControl(pButtonPanel);
        __pPanel[0] = pButtonPanel;
 
        // Orientation panel was created with UI Builder,
        // so only its button events must be defined here
-       __pPanel[1] = static_cast<Panel *>(GetControl(L"IDC_ORIENTATIONPANEL"));
+       __pPanel[1] = static_cast<Panel *>(GetControl(IDC_ORIENTATIONPANEL));
        if (__pPanel[1] != null)
        {
-               __pButtonOrientation = static_cast<Button *>(GetControl(L"IDC_BUTTON_ORIENTATION", true));
+               __pButtonOrientation = static_cast<Button *>(GetControl(IDC_BUTTON_ORIENTATION, true));
 
                if (__pButtonOrientation != null)
                {