?? index.html
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Focus Event Example</title><link href="style.css" rel="stylesheet" type="text/css"></head><table border="0" width="100%" height="8" bgcolor="#eeeeee"><tr> <td width="100%" height="1"><b><font size="2" color="#000000" face="Arial, Helvetica, sans-serif"><strong><a name=Top></a>S60 3rd Edition SDK FP1 for Symbian OS </strong></font></b><br><i>Example Applications Guide</i></td></tr> </table><!-- Generated by Doxygen 1.4.5 --><div class="tabs"> <ul> <li id="current"><a href="index.html"><span>Main Page</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul></div><h1>Focus Event Example</h1><p><a class="el" href="index.html#Intro_sec">1. About this Example</a> <br><a class="el" href="index.html#UI_sec">2. User Interface</a> <br><a class="el" href="index.html#Design_sec">3. Design and Implementation</a><p><hr><h2><a class="anchor" name="Intro_sec">1. About this Example</a></h2>Often an application needs to know when it has lost focus. This would, for example, allow a game to automatically enter pause mode when another application is launched. Situations where the current application might lose focus include:<p><ul><li>Starting another application.</li><li>A system dialog appears, such as the "Recharging" dialog.</li><li>The user switches back to the desktop.</li><li>An incoming phone call is received.</li></ul><p>This example demonstrates how an application can be informed when these events occur, and also when the application regains focus again.<h3><a class="anchor" name="Sub11">1.1 Prerequisites</a></h3>This example exists as a complete application, and has the standard Symbian OS application architecture, employing the Application, Document, UI, and View classes. The reader should be aware of this architecture before continuing.<p><hr><h2><a class="anchor" name="UI_sec">2. User Interface</a></h2>When invoked, the application displays the following screen. The message 'Gained focus' will appear on the application window. On the debug version of the PC emulator only, the message 'Gained focus' will also be displayed for a few seconds.<p><div align="center"><img src="gainedfocus.jpg" alt="gainedfocus.jpg"></div><p><ul><li>Select <b>Exit</b> to exit from the application.</li></ul><p>To show the effect of losing focus, keep the <b>Applications</b> button pressed for approximately three seconds:<p><div align="center"><img src="appbutton.jpg" alt="appbutton.jpg"></div><p>The set of currently running applications will be displayed, and the message 'Lost focus' will appear on the application window. On the PC emulator only, the message 'Lost focus' will appear for a short time.<p><div align="center"><img src="lostfocus.jpg" alt="lostfocus.jpg"></div><h2><a class="anchor" name="Design_sec">3. Design and Implementation</a></h2>The implementation for this example is very simple, and only requires one function in the application user interface:<p><ul><li><a class="el" href="class_c_focus_event_app_ui.html#a5d42e049d7c33367af550ae356b7f8d">CFocusEventAppUi::HandleForegroundEventL</a></li></ul><p>This function is declared as virtual in the base class, as it is called by the framework every time that focus is lost or gained. In this implementation, this function causes a message to be displayed informing the user that they have lost or gained focus. <hr><table x-use-null-cells style="x-cell-content-align: top; width: 100%; border-spacing: 0px; border-spacing: 0px;" cellspacing=0 width=100%> <col style="width: 50%;"> <col style="width: 50%;"> <tr style="x-cell-content-align: top;" valign=top> <td style="width: 50%; padding-right: 10px; padding-left: 10px; border-right-style: None; border-left-style: None; border-top-style: None; border-bottom-style: None;" width=50%> <p style="font-family: Arial;"><small style="font-size: smaller;">
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -