diff options
author | Tomas Junnonen <tomas.junnonen@nokia.com> | 2010-02-15 14:54:48 +0200 |
---|---|---|
committer | Tomas Junnonen <tomas.junnonen@nokia.com> | 2010-02-15 14:54:48 +0200 |
commit | 0299123821c6c6367c23f59e135737f32b26c898 (patch) | |
tree | 48dcda1537576e0c646b4cfe823e83c2186a6a1e /demos/widgetsgallery/pushbuttonpage.cpp |
Changes: First public release
RevBy: TrustMe
Diffstat (limited to 'demos/widgetsgallery/pushbuttonpage.cpp')
-rw-r--r-- | demos/widgetsgallery/pushbuttonpage.cpp | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/demos/widgetsgallery/pushbuttonpage.cpp b/demos/widgetsgallery/pushbuttonpage.cpp new file mode 100644 index 00000000..ba2a10d1 --- /dev/null +++ b/demos/widgetsgallery/pushbuttonpage.cpp @@ -0,0 +1,87 @@ +/*************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (directui@nokia.com) +** +** This file is part of libdui. +** +** If you have questions regarding the use of this file, please contact +** Nokia at directui@nokia.com. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation +** and appearing in the file LICENSE.LGPL included in the packaging +** of this file. +** +****************************************************************************/ + +#include "pushbuttonpage.h" +#include <DuiLabel> +#include <DuiLayout> +#include <DuiLocale> +#include <DuiApplicationPage> +#include <DuiGridLayoutPolicy> +#include <DuiLinearLayoutPolicy> +#include <DuiButton> +#include <DuiButtonIconView> +#include <DuiButtonGroup> +#include <DuiDebug> +#include <DuiApplication> + +PushButtonPage::PushButtonPage() : + TemplatePage(), + pushButton1(0), + pushButton2(0), + pushButton3(0) +{ + gid = TemplatePage::Buttons; +} + +PushButtonPage::~PushButtonPage() +{ +} + +void PushButtonPage::createContent() +{ + TemplatePage::createContent(); + + landscapePolicy->setContentsMargins(30, 0, 0, 0); + + // Push Buttons + pushButton1 = new DuiButton(); + containerPolicy->addItem(pushButton1); + + pushButton2 = new DuiButton(); + pushButton2->setIconID("Icon-music"); + containerPolicy->addItem(pushButton2); + + pushButton3 = new DuiButton(); + containerPolicy->addItem(pushButton3); + + retranslateUi(); +} + +void PushButtonPage::retranslateUi() +{ + //% "Push Button" + setTitle(qtTrId("xx_push_button_page_title")); + if (!isContentCreated()) + return; + //% "Push Buttons can have an icon and a label. " + //% "Push Button can be used in any container but usually " + //% "it is used with Dialogs, Notifications and Main windows " + //% "to invoke actions.\n\n" + //% "A Push Button generally looks like a traditional button, " + //% "with button-style edges." + infoLabel->setText("<a></a>" + qtTrId("xx_push_button_page_info_label")); + //% "Lorem" + pushButton1->setText(qtTrId("xx_push_button_page_button1")); + //% "Ipsum" + pushButton2->setText(qtTrId("xx_push_button_page_button2")); + //% "Dolor\nsit amet" + pushButton3->setText(qtTrId("xx_push_button_page_button3")); +} + + |