wm_setfocus.txt
来自「STM32F103ZET6+UCOSII+UCGUI源码」· 文本 代码 · 共 121 行
TXT
121 行
; generated by ARM C/C++ Compiler with , RVCT4.0 [Build 524] for uVision
; commandline ArmCC [--split_sections --debug -c --asm --interleave -o.\Obj\wm_setfocus.o --depend=.\Obj\wm_setfocus.d --device=DARMSTM --apcs=interwork -O3 -I..\..\include -I..\..\..\FWLib\library\inc -I..\..\..\USBLib\library\inc -I..\..\Config -I..\..\GUI\Core -I..\..\GUI\Font -I..\..\GUI\ConvertColor -I..\..\GUI\AntiAlias -I..\..\GUI\ConvertMono -I..\..\GUI\JPEG -I..\..\GUI\MemDev -I..\..\GUI\MultiLayer -I..\..\GUI\Widget -I..\..\GUI\WM -IC:\Keil\ARM\INC\ST\STM32F10x ..\..\GUI\WM\WM_SetFocus.c]
THUMB
AREA ||i.WM_SetFocus||, CODE, READONLY, ALIGN=2
WM_SetFocus PROC
;;;42 */
;;;43 int WM_SetFocus(WM_HWIN hWin) {
000000 e92d41ff PUSH {r0-r8,lr}
;;;44 int r;
;;;45 WM_MESSAGE Msg = {0};
000004 f04f0100 MOV r1,#0
000008 0007 MOVS r7,r0 ;43
00000a a801 ADD r0,sp,#4
00000c 460a MOV r2,r1
00000e 460b MOV r3,r1
000010 c00e STM r0!,{r1-r3}
;;;46 WM_LOCK();
;;;47 if ((hWin) && (hWin != WM__hWinFocus)) {
000012 d03a BEQ |L1.138|
000014 4c1f LDR r4,|L1.148|
000016 f9b40000 LDRSH r0,[r4,#0] ; WM__hWinFocus
00001a 4287 CMP r7,r0
00001c d035 BEQ |L1.138|
;;;48 WM_NOTIFY_CHILD_HAS_FOCUS_INFO Info;
;;;49 Info.hOld = WM__hWinFocus;
;;;50 Info.hNew = hWin;
;;;51 Msg.MsgId = WM_SET_FOCUS;
00001e 211f MOVS r1,#0x1f
;;;52 /* Send a "no more focus" message to window losing focus */
;;;53 Msg.Data.v = 0;
000020 9101 STR r1,[sp,#4]
000022 f8ad0000 STRH r0,[sp,#0] ;49
000026 2100 MOVS r1,#0
000028 f8ad7002 STRH r7,[sp,#2] ;50
;;;54 if (WM__hWinFocus) {
00002c 9103 STR r1,[sp,#0xc]
00002e b110 CBZ r0,|L1.54|
;;;55 WM_SendMessage(WM__hWinFocus, &Msg);
000030 a901 ADD r1,sp,#4
000032 f7fffffe BL WM_SendMessage
|L1.54|
;;;56 }
;;;57 /* Send "You have the focus now" message to the window */
;;;58 Msg.Data.v = 1;
000036 2001 MOVS r0,#1
;;;59 WM_SendMessage(WM__hWinFocus = hWin, &Msg);
000038 9003 STR r0,[sp,#0xc]
00003a 4638 MOV r0,r7
00003c 8027 STRH r7,[r4,#0]
00003e a901 ADD r1,sp,#4
000040 f7fffffe BL WM_SendMessage
;;;60 if ((r = Msg.Data.v) == 0) { /* On success only */
000044 9e03 LDR r6,[sp,#0xc]
000046 466c MOV r4,sp ;48
;;;61 /* Set message to ancestors of window getting the focus */
;;;62 while ((hWin = WM_GetParent(hWin)) != 0) {
;;;63 Msg.MsgId = WM_NOTIFY_CHILD_HAS_FOCUS;
000048 2521 MOVS r5,#0x21
00004a b9fe CBNZ r6,|L1.140|
00004c e005 B |L1.90|
|L1.78|
;;;64 Msg.Data.p = &Info;
;;;65 WM_SendMessage(hWin, &Msg);
00004e a901 ADD r1,sp,#4
000050 4638 MOV r0,r7
000052 9501 STR r5,[sp,#4]
000054 9403 STR r4,[sp,#0xc]
000056 f7fffffe BL WM_SendMessage
|L1.90|
00005a 4638 MOV r0,r7 ;62
00005c f7fffffe BL WM_GetParent
000060 0007 MOVS r7,r0 ;62
000062 d1f4 BNE |L1.78|
;;;66 }
;;;67 /* Set message to ancestors of window loosing the focus */
;;;68 hWin = Info.hOld;
000064 f9bd7000 LDRSH r7,[sp,#0]
;;;69 if (WM_IsWindow(hWin)) { /* Make sure window has not been deleted in the mean time. Can be optimized: _DeleteWindow could clear the handle to avoid this check (RS) */
000068 4638 MOV r0,r7
00006a f7fffffe BL WM_IsWindow
00006e b168 CBZ r0,|L1.140|
000070 e005 B |L1.126|
|L1.114|
;;;70 while ((hWin = WM_GetParent(hWin)) != 0) {
;;;71 Msg.MsgId = WM_NOTIFY_CHILD_HAS_FOCUS;
;;;72 Msg.Data.p = &Info;
;;;73 WM_SendMessage(hWin, &Msg);
000072 a901 ADD r1,sp,#4
000074 4638 MOV r0,r7
000076 9501 STR r5,[sp,#4]
000078 9403 STR r4,[sp,#0xc]
00007a f7fffffe BL WM_SendMessage
|L1.126|
00007e 4638 MOV r0,r7 ;70
000080 f7fffffe BL WM_GetParent
000084 0007 MOVS r7,r0 ;70
000086 d1f4 BNE |L1.114|
000088 e000 B |L1.140|
|L1.138|
;;;74 }
;;;75 }
;;;76 }
;;;77 } else {
;;;78 r = 1;
00008a 2601 MOVS r6,#1
|L1.140|
;;;79 }
;;;80 WM_UNLOCK();
;;;81 return r;
00008c 4630 MOV r0,r6
;;;82 }
00008e b004 ADD sp,sp,#0x10
000090 e8bd81f0 POP {r4-r8,pc}
;;;83
ENDP
|L1.148|
DCD WM__hWinFocus
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?