- Samsung Galaxy S25 Ultra - titán keret, acélos teljesítmény
- Samsung Galaxy S23 Ultra - non plus ultra
- Garmin Instinct – küldetés teljesítve
- Google Pixel topik
- Nem minden Nothing Phone (3) születik egyenlőnek
- Samsung Galaxy Watch4 és Watch4 Classic - próbawearzió
- Telekom mobilszolgáltatások
- Honor 400 - és mégis mozog a kép
- iOS alkalmazások
- Netfone
Aktív témák
-
flugi
tag
C++ Symbian kód, UIQ (vagyis Ericsson vonal) kiadásra egy hivatalos HelloWorld:
Minden fájl neve bennevan kommentként.
//////
// HelloWorld.h
// ------------
//
// Copyright (c) 2000 Symbian Ltd. All rights reserved.
//
////////////////////////////////////////////////////////////////////
// HelloWorld
// ----------
//
//
// The class definitions for the simple example application
// containing a single view with the text ''Hello World !'' drawn
// on it.
//
// The class definitions are:
//
// CExampleApplication
// CExampleAppUi
// CExampleAppView
// CExampleDocument
//
//
////////////////////////////////////////////////////////////////////
#ifndef __HELLOWORLD_H
#define __HELLOWORLD_H
#include <coeccntx.h>
#include <eikenv.h>
#include <eikappui.h>
#include <eikapp.h>
#include <eikdoc.h>
#include <eikmenup.h>
#include <eikon.hrh>
#include <helloworld.rsg>
#include ''helloworld.hrh''
////////////////////////////////////////////////////////////////////////
//
// CExampleApplication
//
////////////////////////////////////////////////////////////////////////
class CExampleApplication : public CEikApplication
{
private:
// Inherited from class CApaApplication
CApaDocument* CreateDocumentL();
TUid AppDllUid() const;
};
////////////////////////////////////////////////////////////////////////
//
// CExampleAppView
//
////////////////////////////////////////////////////////////////////////
class CExampleAppView : public CCoeControl
{
public:
static CExampleAppView* NewL(const TRect& aRect);
CExampleAppView();
~CExampleAppView();
void ConstructL(const TRect& aRect);
private:
// Inherited from CCoeControl
void Draw(const TRect& /*aRect*/) const;
private:
HBufC* iExampleText;
};
////////////////////////////////////////////////////////////////////////
//
// CExampleAppUi
//
////////////////////////////////////////////////////////////////////////
class CExampleAppUi : public CEikAppUi
{
public:
void ConstructL();
~CExampleAppUi();
private:
// Inherirted from class CEikAppUi
void HandleCommandL(TInt aCommand);
#if defined(_DEBUG)
/* Only used in this application to add a Close item in Debug mode */
void DynInitMenuPaneL(TInt aMenuId, CEikMenuPane* aMenuPane);
#endif
private:
CCoeControl* iAppView;
};
////////////////////////////////////////////////////////////////////////
//
// CExampleDocument
//
////////////////////////////////////////////////////////////////////////
class CExampleDocument : public CEikDocument
{
public:
static CExampleDocument* NewL(CEikApplication& aApp);
CExampleDocument(CEikApplication& aApp);
void ConstructL();
private:
// Inherited from CEikDocument
CEikAppUi* CreateAppUiL();
};
#endif
// HelloWorld.hrh
//
// Copyright (c) 2000 Symbian Ltd. All rights reserved.
//
enum TExampleMenuCommands
{
EExampleItem0 = 200,
EExampleItem1,
EExampleItem2
};
// HelloWorld.mmp
//
// Copyright (c) 2002 Symbian Ltd. All rights reserved.
//
// using relative paths for sourcepath and user includes
TARGET HelloWorld.app
TARGETTYPE app
UID 0x100039CE 0x101F6163
TARGETPATH \system\apps\HelloWorld
SOURCEPATH .
SOURCE HelloWorld_Main.cpp
SOURCE HelloWorld_Application.cpp
SOURCE HelloWorld_Document.cpp
SOURCE HelloWorld_AppUi.cpp
SOURCE HelloWorld_AppView.cpp
USERINCLUDE .
SYSTEMINCLUDE \epoc32\include
RESOURCE HelloWorld.rss
LIBRARY euser.lib apparc.lib cone.lib eikcore.lib eikcoctl.lib
// HelloWorld.RSS
//
// Copyright (c) 1997-1999 Symbian Ltd. All rights reserved.
//
NAME HEWO
#include <eikon.rh>
#include <eikcore.rsg>
#include ''helloworld.hrh''
RESOURCE RSS_SIGNATURE { }
RESOURCE TBUF { buf=''''; }
RESOURCE EIK_APP_INFO
{
hotkeys=r_example_hotkeys;
menubar=r_example_menubar;
}
RESOURCE HOTKEYS r_example_hotkeys
{
control=
{
HOTKEY { command=EEikCmdExit; key='e'; }
};
}
RESOURCE MENU_BAR r_example_menubar
{
titles=
{
MENU_TITLE { menu_pane=r_example_first_menu; txt=''HelloWorld''; }
};
}
RESOURCE MENU_PANE r_example_first_menu
{
items=
{
MENU_ITEM { command=EExampleItem0; txt=''Item 0''; },
MENU_ITEM { command=EExampleItem1; txt=''Item 1''; },
MENU_ITEM { command=EExampleItem2; txt=''Item 2''; }
};
}
RESOURCE TBUF r_example_text_Hello { buf=''Hello World!''; }
RESOURCE TBUF r_example_text_Item0 { buf=''Item 0''; }
RESOURCE TBUF r_example_text_Item1 { buf=''Item 1''; }
RESOURCE TBUF r_example_text_Item2 { buf=''Item 2''; }
RESOURCE TBUF r_example_close_command { buf=''Close (debug)''; }
//// És most jön a lényeg
// HelloWorld_CExampleApplication.cpp
// ----------------------------------
//
// Copyright (c) 2002 Symbian Ltd. All rights reserved.
//
////////////////////////////////////////////////////////////////////////
//
// Source file for the implementation of the
// application class - CExampleApplication
//
////////////////////////////////////////////////////////////////////////
#include ''HelloWorld.h''
const TUid KUidHelloWorld = { 0x101F6163 };
// The function is called by the UI framework to ask for the
// application's UID. The returned value is defined by the
// constant KUidHelloWorlde and must match the second value
// defined in the project definition file.
//
TUid CExampleApplication::AppDllUid() const
{
return KUidHelloWorld;
}
// This function is called by the UI framework at
// application start-up. It creates an instance of the
// document class.
//
CApaDocument* CExampleApplication:: CreateDocumentL()
{
return new (ELeave) CExampleDocument(*this);
}
// HelloWorld_CExampleAppView.cpp
// ------------------------------
//
// Copyright (c) 2000 Symbian Ltd. All rights reserved.
//
////////////////////////////////////////////////////////////////////////
//
// Source file for the implementation of the
// application view class - CExampleAppView
//
////////////////////////////////////////////////////////////////////////
#include ''HelloWorld.h''
//
// Constructor for the view.
//
CExampleAppView:: CExampleAppView()
{
}
// Static NewL() function to start the standard two
// phase construction.
//
CExampleAppView* CExampleAppView::NewL(const TRect& aRect)
{
CExampleAppView* self = new(ELeave) CExampleAppView();
CleanupStack:: PushL(self);
self->ConstructL(aRect);
CleanupStack:: Pop();
return self;
}
//
// Destructor for the view.
//
CExampleAppView::~CExampleAppView()
{
delete iExampleText;
}
// Second phase construction.
//
void CExampleAppView:: ConstructL(const TRect& aRect)
{
// Fetch the text from the resource file.
iExampleText = iEikonEnv->AllocReadResourceL(R_EXAMPLE_TEXT_HELLO);
// Control is a window owning control
CreateWindowL();
// Extent of the control. This is
// the whole rectangle available to application.
// The rectangle is passed to us from the application UI.
SetRect(aRect);
// At this stage, the control is ready to draw so
// we tell the UI framework by activating it.
ActivateL();
}
// Drawing the view - in this example,
// consists of drawing a simple outline rectangle
// and then drawing the text in the middle.
// We use the Normal font supplied by the UI.
//
// In this example, we don't use the redraw
// region because it's easier to redraw to
// the whole client area.
//
void CExampleAppView:: Draw(const TRect& /*aRect*/) const
{
// Window graphics context
CWindowGc& gc = SystemGc();
// Area in which we shall draw
TRect drawRect = Rect();
// Font used for drawing text
const CFont* fontUsed;
// Start with a clear screen
gc.Clear();
// Draw an outline rectangle (the default pen
// and brush styles ensure this) slightly
// smaller than the drawing area.
drawRect.Shrink(10,10);
gc.DrawRect(drawRect);
// Use the title font supplied by the UI
fontUsed = iEikonEnv->TitleFont();
gc.UseFont(fontUsed);
// Draw the text in the middle of the rectangle.
TInt baselineOffset=(drawRect.Height() - fontUsed->HeightInPixels())/2;
gc.DrawText(*iExampleText,drawRect,baselineOffset,CGraphicsContext::ECenter, 0);
// Finished using the font
gc.DiscardFont();
}
// HelloWorld_CExampleAppUi.cpp
// ----------------------------
//
// Copyright (c) 2002 Symbian Ltd. All rights reserved.
//
////////////////////////////////////////////////////////////////////////
//
// Source file for the implementation of the
// application UI class - CExampleAppUi
//
////////////////////////////////////////////////////////////////////////
// To enable the dynamic loading of the menu with a Close command in the UDEB version
#include <eikmenub.h>
#include ''HelloWorld.h''
// The second phase constructor of the application UI class.
// The application UI creates and owns the one and only view.
//
void CExampleAppUi:: ConstructL()
{
// BaseConstructL() completes the UI framework's
// construction of the App UI.
BaseConstructL();
// Create the single application view in which to
// draw the text ''Hello World!'', passing into it
// the rectangle available to it.
iAppView = CExampleAppView::NewL(ClientRect());
}
// The app Ui owns the two views and is.
// therefore, responsible for destroying them
//
CExampleAppUi::~CExampleAppUi()
{
delete iAppView;
}
// Called by the UI framework when a command has been issued.
// In this example, a command can originate through a
// hot-key press or by selection of a menu item.
// The command Ids are defined in the .hrh file
// and are 'connected' to the hot-key and menu item in the
// resource file.
// Note that the EEikCmdExit is defined by the UI
// framework and is pulled in by including eikon.hrh
//
void CExampleAppUi::HandleCommandL(TInt aCommand)
{
switch (aCommand)
{
// Just issue simple info messages to show that
// the menu items have been selected
case EExampleItem0:
iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM0);
break;
case EExampleItem1:
iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM1);
break;
case EExampleItem2:
iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM2);
break;
// Exit the application. The call is
// implemented by the UI framework.
case EEikCmdExit:
Exit();
break;
}
}
// This is a way to dynamically initialize the menu.
// If it is the debug version, the menu should contain a Close command.
// In the release version, there should be no Close command.
#if defined(_DEBUG)
void CExampleAppUi:: DynInitMenuPaneL(TInt aMenuId, CEikMenuPane* aMenuPane)
{
if(aMenuId == R_EXAMPLE_FIRST_MENU)
{
CEikMenuPaneItem::SData itemData;
TBuf<16> closeCommandText;
iEikonEnv->ReadResource(closeCommandText, R_EXAMPLE_CLOSE_COMMAND);
itemData.iText=closeCommandText;
itemData.iCommandId=EEikCmdExit;
itemData.iFlags=0;
itemData.iCascadeId=0;
aMenuPane->AddMenuItemL(itemData);
}
}
#endif
// HelloWorld_CExampleDocument.cpp
// -------------------------------
//
// Copyright (c) 2000 Symbian Ltd. All rights reserved.
//
////////////////////////////////////////////////////////////////////////
//
// Source file for the implementation of the
// document class - CExampleDocument
//
////////////////////////////////////////////////////////////////////////
#include ''HelloWorld.h''
// The constructor of the document class just passes the
// supplied reference to the constructor initialisation list.
// The document has no real work to do in this application.
//
CExampleDocument:: CExampleDocument(CEikApplication& aApp)
: CEikDocument(aApp)
{
}
// This is called by the UI framework as soon as the
// document has been created. It creates an instance
// of the ApplicationUI. The Application UI class is
// an instance of a CEikAppUi derived class.
//
CEikAppUi* CExampleDocument:: CreateAppUiL()
{
return new(ELeave) CExampleAppUi;
}
// HelloWorld_Main.cpp
// -------------------
//
// Copyright (c) 2000 Symbian Ltd. All rights reserved.
//
////////////////////////////////////////////////////////////////////////
//
// HelloWorld
// ----------
//
//
// The example is a simple application containing a single view with
// the text ''Hello World !'' drawn on it.
//
// The example includes code for displaying a very simple menu.
//
// ---------------------------------------------------------------------
//
// This source file contains the single exported function required by
// all UI applications and the E32Dll function which is also required
// but is not used here.
//
////////////////////////////////////////////////////////////////////////
#include ''HelloWorld.h''
// The entry point for the application code. It creates
// an instance of the CApaApplication derived
// class, CExampleApplication.
//
EXPORT_C CApaApplication* NewApplication()
{
return new CExampleApplication;
}
// This function is required by all EPOC32 DLLs. In this
// example, it does nothing.
//
GLDEF_C TInt E32Dll(TDllReason)
{
return KErrNone;
}
/////////////////////
Laza, mi?
[Szerkesztve: szmájlikat kiírtottam amik a kódban a kettőspont-dé és hasonlók miatt jöttek be]
[Szerkesztve]
Aktív témák
- Intel Core i3 / i5 / i7 / i9 10xxx "Comet Lake" és i3 / i5 / i7 / i9 11xxx "Rocket Lake" (LGA1200)
- D1Rect: Nagy "hülyétkapokazapróktól" topik
- Hisense LCD és LED TV-k
- Diablo IV
- Formula-1
- Nintendo Switch 2
- Samsung Galaxy S25 Ultra - titán keret, acélos teljesítmény
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- Milyen asztali (teljes vagy fél-) gépet vegyek?
- Tőzsde és gazdaság
- További aktív témák...
- ÁRGARANCIA!Épített KomPhone i7 14700KF 32/64GB RAM RTX 5070Ti 16GB GAMER PC termékbeszámítással
- Eredeti DELL 240W töltők (LA240PM160)
- LG 55C4 - 48" OLED evo - 4K 144Hz - 0.1ms - NVIDIA G-Sync - FreeSync - HDMI 2.1 - A9 Gen7 CPU
- Apple iPhone 7 Plus 32GB, Kártyafüggetlen, 1 Év Garanciával
- Bomba ár! Dell Latitude E6410 - i5 I 4GB I 250GB I DVDROM I 14,1" WXGA I Garancia!
Állásajánlatok
Cég: PC Trade Systems Kft.
Város: Szeged
Cég: Promenade Publishing House Kft.
Város: Budapest