untitled

Similar documents
<4D F736F F F696E74202D C DB5DA3136D5C25FCAC2BCFEC7FDB6AFB3CCD0F2C9E8BCC62E BBCE6C8DDC4A3CABD5D>

威 福 髮 藝 店 桃 園 市 蘆 竹 區 中 山 里 福 祿 一 街 48 號 地 下 一 樓 50,000 獨 資 李 依 純 105/04/06 府 經 登 字 第 號 宏 品 餐 飲 桃 園 市 桃 園 區 信 光 里 民

第一章

untitled

概述

团 学 要 闻 我 校 召 开 共 青 团 五 届 九 次 全 委 ( 扩 大 ) 会 议 3 月 17 日, 我 校 共 青 团 五 届 九 次 全 委 ( 扩 大 ) 会 议 在 行 政 办 公 楼 五 楼 会 议 室 举 行, 校 团 委 委 员 各 院 ( 系 ) 团 委 书 记 校 学 生

Chapter 9: Objects and Classes

國立嘉義高中96學年度資優班語資班成班考國文科試題

詞 彙 表 編 號 詞 彙 描 述 1 預 約 人 資 料 中 文 姓 名 英 文 姓 名 身 份 證 字 號 預 約 人 電 話 性 別 2 付 款 資 料 信 用 卡 別 信 用 卡 號 信 用 卡 有 效 日 期 3 住 房 條 件 入 住 日 期 退 房 日 期 人 數 房 間 數 量 入

C 1

untitled

untitled

Microsoft Word - ch04三校.doc

Swing-02.pdf

mvc

ebook

ebook39-6

C 1 # include <stdio.h> 2 int main ( void ) { 4 int cases, i; 5 long long a, b; 6 scanf ("%d", & cases ); 7 for (i = 0;i < cases ;i ++) 8 { 9

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc

EJB-Programming-3.PDF

C/C++语言 - C/C++数据

基于ECO的UML模型驱动的数据库应用开发1.doc

chp11.ppt

nb.PDF

Java事件处理模型

59 1 CSpace 2 CSpace CSpace URL CSpace 1 CSpace URL 2 Lucene 3 ID 4 ID Web 1. 2 CSpace LireSolr 3 LireSolr 3 Web LireSolr ID


FY.DOC

<ADB6ADB1C25EA8FAA6DB2D4D56432E706466>

Microsoft Word - 01.DOC

untitled

Microsoft Word - Learn Objective-C.doc

概述

深入理解otter

Microsoft Word - 投影片ch18

第1章

说 : 荀 子 极 偏 驳, 只 一 句 性 恶, 大 本 已 失 5 朱 熹 说 : 荀 扬 不 惟 说 性 不 是, 从 头 到 底 皆 不 识 6 采 取 的 都 是 这 种 理 论 框 架 另 一 种 理 论 框 架 始 于 20 世 纪 前 期, 这 便 是 诸 子 学 研 究 的 框 架

可 Web 编程的NativeUI 设计与实现

Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.06.doc

主程式 : public class Main3Activity extends AppCompatActivity { ListView listview; // 先整理資料來源,listitem.xml 需要傳入三種資料 : 圖片 狗狗名字 狗狗生日 // 狗狗圖片 int[] pic =new

3. 反 映 : 4. 五 花 八 门 : 5. 慷 慨 : 6. 参 与 : 7. 慰 劳 : 8. 延 续 : 9. 珍 爱 : 10. 浪 漫 : 三. 找 出 下 列 每 组 词 中 的 近 义 词 或 同 义 词 : 节 日 节 气 节 令 时 节 习 俗 民 俗 仪 式 风 俗 文 献

2013 C 1 # include <stdio.h> 2 int main ( void ) 3 { 4 int cases, a, b, i; 5 scanf ("%d", & cases ); 6 for (i = 0;i < cases ;i ++) 7 { 8 scanf ("%d %d

e bug 0 x=0 y=5/x 0 Return 4 2

INTRODUCTION TO COM.DOC

untitled

untitled

untitled

ebook39-5

提纲 1 2 OS Examples for 3

新版 明解C++入門編

untitled

A B C D E A B C F A C. D F. A. B. C. D. E. F.

(TestFailure) JUnit Framework AssertionFailedError JUnit Composite TestSuite Test TestSuite run() run() JUnit

ebook 86-15

Microsoft Word - MIS.doc

訪 談 後 的 檢 討 ~~~~~~~~~~~~~~~~p.18,19 2

Microsoft PowerPoint - Model Checking a Lazy Concurrent List-Based Set Algorithm.ppt [Compatibility Mode]

台北市立大安高工職業學校

PPI ( 2. / 3. AIS R VRM EBL R R U/6X 5

Java

epub83-1

untitled

Strings

untitled

Microsoft PowerPoint 龍華科技大學遊戲系-Unity teaching


Microsoft PowerPoint - plan08.ppt

Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0,

RunPC2_.doc

没 有 多 余 的 Contruol 或 Action 了 原 来 Domain 层 被 服 务 层 Service layer 遮 挡, 在 右 边 图 中, 则 Domain 层 直 接 暴 露 给 前 台 了, 没 有 被 遮 挡, 裸 露 了 这 样 一 步 到 位 实 现 领 域 模 型

普 卡 : 賠 償 金 額 實 支 實 付 最 高 以 新 台 幣 柒 仟 元 整 為 限 ( 持 卡 人 及 家 屬 實 支 實 付 合 計 最 高 以 新 台 幣 壹 萬 肆 仟 元 整 為 限 ) 2. 行 李 延 誤 ( 六 ~ 二 十 四 小 時 ) 被 保 險 人 於 其 所 搭 乘 之

untitled

BOOL EnumWindows(WNDENUMPROC lparam); lpenumfunc, LPARAM (Native Interface) PowerBuilder PowerBuilder PBNI 2

Figure 1: Game Tree 为 了 方 便 讨 论, 我 们 这 里 设 这 里 讨 论 的 博 弈 树 是 一 棵 有 限 树, 设 有 两 个 棋 手 甲 与 乙 进 行 这 场 博 弈, 这 样, 博 弈 树 分 为 三 类 结 点 : 1. 奇 数 层 的 非 叶 子 结 点 :

Microsoft PowerPoint - string_kruse [兼容模式]

第二章 各級人員工作職責

Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.07.doc

Chapter 9: Objects and Classes

1 Project New Project 1 2 Windows 1 3 N C test Windows uv2 KEIL uvision2 1 2 New Project Ateml AT89C AT89C51 3 KEIL Demo C C File

JBuilder Weblogic

EJB-Programming-4-cn.doc

2009年3月全国计算机等级考试二级Java语言程序设计笔试试题

untitled


1 目 錄 1. 簡 介 一 般 甄 試 程 序 第 一 階 段 的 準 備 第 二 階 段 的 準 備 每 間 學 校 的 面 試 方 式 各 程 序 我 的 做 法 心 得 及 筆 記 結 論..

CC213

我是誰?

LEFT, RIGHT // 左 // 右 (2) 当图片移动后, 按钮的坐标发生改变, 此操作通过 setloca tion() 方法实现 setlocation() 方法是从 Component 类继承的, 其定义如下 : public void setlocation(int x, int y

文档 3

Important Notice SUNPLUS TECHNOLOGY CO. reserves the right to change this documentation without prior notice. Information provided by SUNPLUS TECHNOLO

IP Access Lists IP Access Lists IP Access Lists

图形学 Project 2 要求 任意两个多边形, 求出其相交的区域 使用说明 例 1 第一步, 与 Project 1 画多边形的方法相同, 画一个多边形 ; 第二步, 单击 INTERSECT WITH, 随后画出第二个多边形 ; 第三步, 单击 FILL 进行填充

javaexample-02.pdf

Microsoft Word - (web)_F.1_Notes_&_Application_Form(Chi)(non-SPCCPS)_16-17.doc

06 01 action JavaScript action jquery jquery AJAX CSS jquery CSS jquery HTML CSS jquery.css() getter setter.css('backgroundcolor') jquery CSS b

Outline USB Application Requirements Variable Definition Communications Code for VB Code for Keil C Practice

全国计算机技术与软件专业技术资格(水平)考试

untitled

untitled

epub 32-2

Transcription:

OGRE http://antsam.blogone.net AntsamCGD@hotmail.com OGRE OGRE listener listener target listener target Dispatcher Processor Input Reader Event class view Event Class view Input Event ctrlaltshift ascoll GUI Event EventTarget

EventTarget Class View Event Class View Key Target Position Target target MouseTargetMouseMotionTarget Listener class view Listener class view

listener InputEvent EventTarget* msource EventTarget EventListener Command Event Target Command Listener Receiver Input Event Invoker Input Event Queue

EventQueue std : :queue<inputevent*> meventqueue void pus h() InputEvent* pop() Target Target Manager Target Manager target Target ManagerOverlay Overlay Manager Target Manager 3D Target 3D Object Manager target visibility overlay 3D object triger Listener Target Input Event get Source Event Target get listener Input Reader InputReader EventQueue* meventqueue Cursor* mcurs or Dispatcher Processor EventDispatcher TargetManager* mtargetmanager; EventProcessor* meventprocessor PositionTarget* mfocus; PositionTarget* mmousepositiontarget PositionTarget* mkeycursoron PositionTarget* mtargetlastentered bool processkeyevent() bool processmouseevent() void retargetmouseevent() void setmousetarget() void trackmouseenterexit() bool dispatchevent()

EventProcessor EventQueue* meventqueue InputReader* minputdevice DispatcherList mdispatcherlist void startprocessingevents() void stopprocessingevents() void initialise() void processevent() void addcursormovelistener() void removecursormovelistener() void addtargetmanager() bool framestarted()

InputReader EventQueue* meventqueue Cursor* mcurs or void getmousestate() bool getmousebutton() void m ousemove d() void createmouseeven t() void tri ggermo usebutton() void createkeyevent() void ke ychanged()

Cursor Real mmousex, mmousey, mmousez Real mrelx, mrely, mrelz Real mxlowlimit, mxhighlimit, mylowlimit, Real myhighlimit, mzlowlimit, mzhighlimit

Example Frame ListenerGUI Frame Listener GUI Application ActionTarget* at = static_cast<borderbuttonguielement*>(guimanager::getsingleton().getguielement("ss/setup/hosts creen/join")); at->addactionlistener(this); at = static_cast<borderbuttonguielement*>(guimanager::getsingleton().getguielement("ss/setup/hosts creen/exit")); at->addactionlistener(this);.. ListChanger* list = static_cast<listguielement*>(guimanager::getsingleton().getguielement("ss/setup/hostscreen/ava ilablegameslist")); (GuiManager::getSingleton().getGuiElement("Core/CurrFps"))->addMouseListener(this); bool EventDispatcher::dispatchEvent(InputEvent* e). MouseEvent* me = static_cast<mouseevent*> (e); ret = processmouseevent(me);

.. KeyEvent* ke = static_cast<keyevent*> (e); ret = processkeyevent(ke); processmouseevent bool EventDispatcher::processMouseEvent(MouseEvent* e) mmousepositiontarget->processevent(e); targetover = mtargetmanager->getpositiontargetat(e->getx(), e->gety()); setmousetarget(targetover, e); void EventDispatcher::setMouseTarget(PositionTarget* target, MouseEvent* e) if (target!= mmousepositiontarget) mmousepositiontarget = target; void GuiElement::processEvent(InputEvent* e) if (!menabled e->isconsumed()) return; switch(e->getid()) case ActionEvent::AE_ACTION_PERFORMED:

processactionevent(static_cast<actionevent*>(e)); case MouseEvent::ME_MOUSE_PRESSED: case MouseEvent::ME_MOUSE_RELEASED: case MouseEvent::ME_MOUSE_CLICKED: case MouseEvent::ME_MOUSE_ENTERED: case MouseEvent::ME_MOUSE_EXITED: processmouseevent(static_cast<mouseevent*>(e)); case MouseEvent::ME_MOUSE_MOVED: case MouseEvent::ME_MOUSE_DRAGGED: processmousemotionevent(static_cast<mouseevent*>(e)); void ActionTarget::processActionEvent(ActionEvent* e) ActionListener* listener = mactionlistener; if (listener!= NULL) int id = e->getid(); switch(id) case ActionEvent::AE_ACTION_PERFORMED: listener->actionperformed(e); void MouseTarget::processMouseEvent(MouseEvent* e) MouseListener* listener = mmouselistener; if (listener!= NULL) int id = e->getid(); switch(id) case MouseEvent::ME_MOUSE_PRESSED: listener->mousepressed(e); case MouseEvent::ME_MOUSE_RELEASED: listener->mousereleased(e);

case MouseEvent::ME_MOUSE_CLICKED: listener->mouseclicked(e); case MouseEvent::ME_MOUSE_EXITED: mmousewithin = false; listener->mouseexited(e); case MouseEvent::ME_MOUSE_ENTERED: mmousewithin = true; listener->mouseentered(e); void MouseMotionTarget::processMouseMotionEvent(MouseEvent* e) MouseMotionListener* listener = mmousemotionlistener; if (listener!= NULL) int id = e->getid(); switch(id) case MouseEvent::ME_MOUSE_MOVED: listener->mousemoved(e); case MouseEvent::ME_MOUSE_DRAGGED: listener->mousedragged(e); void mouseclicked(mouseevent* e) void mouseentered(mouseevent* e) int i =5;

void mouseexited(mouseevent* e) void mousepressed(mouseevent* e) void mousereleased(mouseevent* e) void actionperformed(actionevent* e) // Think about doing something here std::string action = e->getactioncommand(); LogManager::getSingleton().logMessage("Got event: " + action); if (action == "SS/Setup/HostScreen/Exit") // Queue a shutdown static_cast<guiframelistener*>(mframelistener)->requestshutdown();