📄 messagebox.txt
字号:
; generated by ARM C/C++ Compiler with , RVCT4.0 [Build 524] for uVision
; commandline ArmCC [--split_sections --debug -c --asm --interleave -o.\Obj\messagebox.o --depend=.\Obj\messagebox.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\Widget\MESSAGEBOX.c]
THUMB
AREA ||i.GUI_MessageBox||, CODE, READONLY, ALIGN=1
GUI_MessageBox PROC
;;;194 */
;;;195 int GUI_MessageBox(const char * sMessage, const char * sCaption, int Flags) {
000000 b510 PUSH {r4,lr}
;;;196 WM_HWIN hWin;
;;;197 hWin = MESSAGEBOX_Create(sMessage, sCaption, Flags);
000002 f7fffffe BL MESSAGEBOX_Create
;;;198 /* Exec dialog */
;;;199 return GUI_ExecCreatedDialog(hWin);
000006 e8bd4010 POP {r4,lr}
00000a f7ffbffe B.W GUI_ExecCreatedDialog
;;;200 }
;;;201
ENDP
AREA ||i.MESSAGEBOX_Create||, CODE, READONLY, ALIGN=2
MESSAGEBOX_Create PROC
;;;114 */
;;;115 WM_HWIN MESSAGEBOX_Create(const char * sMessage, const char * sCaption, int Flags) {
000000 e92d4ff7 PUSH {r0-r2,r4-r11,lr}
000004 b096 SUB sp,sp,#0x58
;;;116 GUI_WIDGET_CREATE_INFO _aDialogCreate[3]; /* 0: FrameWin, 1: Text, 2: Button */
;;;117 int BorderSize = FRAMEWIN_GetDefaultBorderSize(); /* Default border size of frame window */
000006 f7fffffe BL FRAMEWIN_GetDefaultBorderSize
;;;118 int xSizeFrame = MESSAGEBOX_XSIZEOK + 2 * BorderSize + MESSAGEBOX_BORDER * 2; /* XSize of frame window */
00000a 213a MOVS r1,#0x3a
00000c eb010440 ADD r4,r1,r0,LSL #1
000010 4605 MOV r5,r0 ;117
;;;119 int ySizeFrame; /* YSize of frame window */
;;;120 int x0, y0; /* Position of frame window */
;;;121 int xSizeMessage; /* Length in pixels of message */
;;;122 int xSizeCaption; /* Length in pixels of caption */
;;;123 int ySizeCaption; /* YSize of caption */
;;;124 int ySizeMessage; /* YSize of message */
;;;125 GUI_RECT Rect;
;;;126 const GUI_FONT GUI_UNI_PTR * pOldFont;
;;;127 /* Zeroinit variables */
;;;128 memset(_aDialogCreate, 0, sizeof(_aDialogCreate));
000012 2148 MOVS r1,#0x48
000014 a804 ADD r0,sp,#0x10
000016 f7fffffe BL __aeabi_memclr4
;;;129 /* Get dimension of message */
;;;130 pOldFont = GUI_SetFont(TEXT_GetDefaultFont());
00001a f7fffffe BL TEXT_GetDefaultFont
00001e f7fffffe BL GUI_SetFont
000022 4683 MOV r11,r0
;;;131 GUI_GetTextExtend(&Rect, sMessage, 255);
000024 22ff MOVS r2,#0xff
000026 a802 ADD r0,sp,#8
000028 9916 LDR r1,[sp,#0x58]
00002a f7fffffe BL GUI_GetTextExtend
;;;132 xSizeMessage = Rect.x1 - Rect.x0 + MESSAGEBOX_BORDER * 2;
00002e f9bd000c LDRSH r0,[sp,#0xc]
000032 f9bd1008 LDRSH r1,[sp,#8]
000036 1a40 SUBS r0,r0,r1
000038 f1000708 ADD r7,r0,#8
;;;133 ySizeMessage = Rect.y1 - Rect.y0 + 1;
00003c f9bd000e LDRSH r0,[sp,#0xe]
000040 f9bd100a LDRSH r1,[sp,#0xa]
000044 1a40 SUBS r0,r0,r1
000046 f1000801 ADD r8,r0,#1
;;;134 if (xSizeFrame < (xSizeMessage + 4 + MESSAGEBOX_BORDER * 2)) {
00004a f107000c ADD r0,r7,#0xc
00004e 4284 CMP r4,r0
000050 da00 BGE |L2.84|
;;;135 xSizeFrame = xSizeMessage + 4 + MESSAGEBOX_BORDER * 2;
000052 4604 MOV r4,r0
|L2.84|
;;;136 }
;;;137 ySizeCaption = GUI_GetYSizeOfFont(FRAMEWIN_GetDefaultFont());
000054 f7fffffe BL FRAMEWIN_GetDefaultFont
000058 f7fffffe BL GUI_GetYSizeOfFont
;;;138 ySizeFrame = ySizeMessage + /* size of message */
00005c 4440 ADD r0,r0,r8
00005e eb000645 ADD r6,r0,r5,LSL #1
000062 3621 ADDS r6,r6,#0x21
;;;139 MESSAGEBOX_YSIZEOK + /* size of button */
;;;140 ySizeCaption + /* caption size */
;;;141 MESSAGEBOX_BORDER * 3 + /* inner border - text, text - button, button - bottom */
;;;142 BorderSize * 2 + /* top & bottom border */
;;;143 1; /* inner border */
;;;144 /* Get xsize of caption */
;;;145 xSizeCaption = GUI_GetStringDistX(sCaption);
000064 9817 LDR r0,[sp,#0x5c]
000066 f7fffffe BL GUI_GetStringDistX
;;;146 if (xSizeFrame < xSizeCaption + BorderSize * 2) {
00006a eb000045 ADD r0,r0,r5,LSL #1
00006e 42a0 CMP r0,r4
000070 dd00 BLE |L2.116|
;;;147 xSizeFrame = xSizeCaption + BorderSize * 2;
000072 4604 MOV r4,r0
|L2.116|
;;;148 }
;;;149 /* Check maximum */
;;;150 if (xSizeFrame > LCD_GET_XSIZE()) {
000074 f7fffffe BL LCD_GetXSize
000078 42a0 CMP r0,r4
00007a da02 BGE |L2.130|
;;;151 xSizeFrame = LCD_GET_XSIZE();
00007c f7fffffe BL LCD_GetXSize
000080 4604 MOV r4,r0
|L2.130|
;;;152 }
;;;153 if (ySizeFrame > LCD_GET_YSIZE()) {
000082 f7fffffe BL LCD_GetYSize
000086 42b0 CMP r0,r6
000088 da02 BGE |L2.144|
;;;154 ySizeFrame = LCD_GET_YSIZE();
00008a f7fffffe BL LCD_GetYSize
00008e 4606 MOV r6,r0
|L2.144|
;;;155 }
;;;156 /* Calculate position of framewin */
;;;157 x0 = (LCD_GET_XSIZE() - xSizeFrame) / 2;
000090 f7fffffe BL LCD_GetXSize
000094 1b00 SUBS r0,r0,r4
000096 eb0070d0 ADD r0,r0,r0,LSR #31
00009a ea4f0960 ASR r9,r0,#1
;;;158 y0 = (LCD_GET_YSIZE() - ySizeFrame) / 2;
00009e f7fffffe BL LCD_GetYSize
0000a2 1b80 SUBS r0,r0,r6
0000a4 eb0070d0 ADD r0,r0,r0,LSR #31
0000a8 ea4f0a60 ASR r10,r0,#1
;;;159 /* restore modified Context */
;;;160 GUI_SetFont(pOldFont);
0000ac 4658 MOV r0,r11
0000ae f7fffffe BL GUI_SetFont
;;;161 /* Fill frame win resource */
;;;162 _aDialogCreate[0].pfCreateIndirect = FRAMEWIN_CreateIndirect;
0000b2 4826 LDR r0,|L2.332|
;;;163 _aDialogCreate[0].pName = sCaption;
0000b4 9004 STR r0,[sp,#0x10]
0000b6 9817 LDR r0,[sp,#0x5c]
;;;164 _aDialogCreate[0].x0 = x0;
0000b8 9005 STR r0,[sp,#0x14]
;;;165 _aDialogCreate[0].y0 = y0;
;;;166 _aDialogCreate[0].xSize = xSizeFrame;
;;;167 _aDialogCreate[0].ySize = ySizeFrame;
;;;168 if (Flags & GUI_MESSAGEBOX_CF_MOVEABLE) {
0000ba 9818 LDR r0,[sp,#0x60]
0000bc f8ada01c STRH r10,[sp,#0x1c] ;165
0000c0 f8ad901a STRH r9,[sp,#0x1a] ;164
0000c4 f8ad401e STRH r4,[sp,#0x1e] ;166
0000c8 f8ad6020 STRH r6,[sp,#0x20] ;167
0000cc 06c0 LSLS r0,r0,#27
0000ce d502 BPL |L2.214|
;;;169 _aDialogCreate[0].Flags = FRAMEWIN_CF_MOVEABLE;
0000d0 2010 MOVS r0,#0x10
0000d2 f8ad0022 STRH r0,[sp,#0x22]
|L2.214|
;;;170 }
;;;171 /* Fill text resource */
;;;172 _aDialogCreate[1].pfCreateIndirect = TEXT_CreateIndirect;
0000d6 481e LDR r0,|L2.336|
;;;173 _aDialogCreate[1].pName = sMessage;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -