📄 guiwindp.inc
字号:
mov dl,[GUIWincol] inc dl mov eax,[GUIwinposx+%1*4] mov ebx,[GUIwinposy+%1*4] add ebx,10 mov ecx,eax add ecx,[GUIwinsizex+%1*4] mov esi,12%%loop1 DrawGUILine dec esi jnz %%loop1 add dl,3 inc eax DrawGUILine sub ebx,13 ; set ebx to minY dec eax ; set eax to minX%endmacro%macro DrawTabOn 1 ; %1 = array, ebp = offset, eax = minX, ebx = minY push edi mov esi,%1 mov ecx,8 add ecx,eax%%skip cmp byte[esi+ebp],0 jne %%read1 inc ebp jmp %%skip%%read1 cmp byte[esi+ebp],0 je %%ok1 inc esi add ecx,6 jmp %%read1%%ok1 mov dl,[GUIWincol] add dl,4 inc eax DrawGUILine sub dl,2 mov esi,12%%draw1 DrawGUILine dec esi jnz %%draw1 sub ebx,12 push ecx ; save X offset for next drawing step dec eax mov ecx,eax mov esi,11 inc dl%%draw2 DrawGUILine dec esi jnz %%draw2 sub ebx,11 push ebx ; save Y offset for next drawing step mov cl,[GUIWincol] mov [GUItextcolor],cl add ebx,4 push ebx ; save label Yoff mov edx,eax add edx,6 push edx ; save label Xoff SetVidbufLoc mov edi,%1 add edi,ebp call GUIOutputStringwin pop edx pop ebx mov byte[GUItextcolor],163 cmp byte[GUIWincoladd],0 je %%nochange mov byte[GUItextcolor],164%%nochange dec edx dec ebx SetVidbufLoc mov edi,%1 add edi,ebp call GUIOutputStringwin mov byte[GUItextcolor],217 ; restore normal colour pop ebx ; restore Yoff for drawing step pop eax inc eax ; restore and set Xoff for drawing step mov ecx,eax mov dl,[GUIWincol] add dl,3 mov esi,12%%draw3 DrawGUILine dec esi jnz %%draw3 sub ebx,13 inc eax%%read2 mov esi,%1 cmp byte[esi+ebp],0 je %%ok2 inc ebp jmp %%read2%%ok2 pop edi%endmacro%macro DrawTabOff 1 ; %1 = array, ebp = offset, eax = minX, ebx = minY push edi mov esi,%1 mov ecx,8 add ecx,eax%%skip cmp byte[esi+ebp],0 jne %%read1 inc ebp jmp %%skip%%read1 cmp byte[esi+ebp],0 je %%ok1 inc esi add ecx,6 jmp %%read1%%ok1 mov dl,[GUIWincol] add dl,3 inc eax inc ebx DrawGUILine dec dl push ecx ; save Xoff for next drawing step dec eax mov ecx,eax mov esi,10%%draw1 DrawGUILine dec esi jnz %%draw1 sub ebx,10 push ebx ; save Yoff for next drawing step mov byte[GUItextcolor],202 cmp byte[GUIWincoladd],0 je %%nochange mov byte[GUItextcolor],196%%nochange add ebx,4 push ebx ; save label Yoff mov edx,eax add edx,6 push edx ; save label Xoff SetVidbufLoc mov edi,%1 add edi,ebp call GUIOutputStringwin pop edx pop ebx add byte[GUItextcolor],15 dec edx dec ebx SetVidbufLoc mov edi,%1 add edi,ebp call GUIOutputStringwin pop ebx ; restore Yoff for drawing step pop eax inc eax ; restore and set Xoff for drawing step mov ecx,eax mov dl,[GUIWincol] mov esi,10%%draw2 DrawGUILine dec esi jnz %%draw2 sub ebx,12 inc eax%%read2 mov esi,%1 cmp byte[esi+ebp],0 je %%ok2 inc ebp jmp %%read2%%ok2 pop edi%endmacro%macro GUIDrawTabs 1 ; tabs/label array mov ecx,[%1+4] ; total # cmp ecx,0 je near %%nodraw mov esi,[%1] ; active tab mov ebp,8 ; set array offset at top of labels%%loop2 dec esi ; check if tab is the current one push ecx push esi jnz near %%disabled DrawTabOn %1 ; draws tab, updates eax, ebx & ebp for next tab... jmp near %%done%%disabled DrawTabOff %1 ; ... and autosizes the tab for its label%%done pop esi pop ecx dec ecx jnz %%loop2%%nodraw%endmacro%macro GUIDrawSlider 8 ; win #id, minX, width, Ypos, var, text, proc1, proc2 mov eax,[GUIwinposx+%1*4] mov ebx,[GUIwinposy+%1*4] add eax,%2 add ebx,%4 mov ecx,eax add ecx,%3 xor edx,edx mov dl,215 sub dl,[GUIWincoladd] DrawGUILine inc ecx inc eax sub dl,13 DrawGUILine xor eax,eax %7 %5 ; proc1 == alters var correctly and puts result in al mov dword[GUITemp],%2-4 add [GUITemp],eax GUIDisplayIconWin %1,[GUITemp],%4-4,GUIIconDataSlideBar %8 %5,%6 ; proc2 == alters text correctly and puts pointer in esi mov [GUITemp],esi ; Display Value (Green) GUIDisplayTextG %1,%2+%3+6,%4-1,[GUITemp]%endmacro%macro DrawBorderedBox 6; ; draw borders mov dl,[GUIWincol] DrawGUIWinBox %1,%2,%6,%4,%3,dl ; freezes if you replace %6 with %3-1 mov dl,[GUIWincol] inc dl DrawGUIWinBox %1,%2-1,%3,%2,%5,dl mov dl,[GUIWincol] add dl,4 DrawGUIWinBox %1,%2,%5,%4,%5+1,dl mov dl,[GUIWincol] add dl,3 DrawGUIWinBox %1,%4,%3,%4+1,%5,dl DrawGUIWinBox %1,%2,%3,%4,%5,167%endmacro%macro DrawBorderedBoxB 7 ; Special function for combo displays ; draw borders mov dl,[GUIWincol] DrawGUIWinBox %1,%2,%6,%4,%3,dl mov dl,[GUIWincol] inc dl DrawGUIWinBox %1,%2-1,%3,%2,%5,dl mov dl,[GUIWincol] add dl,4 DrawGUIWinBox %1,%2,%5,%4,%5+1,dl mov dl,[GUIWincol] add dl,3 DrawGUIWinBox %1,%4,%3,%4+1,%5,dl DrawGUIWinBox %1,%2,%3,%4,%5,167 mov byte[GUIComboText3],%7 mov byte[GUItextcolor],223 GUIOuttextwin2 %1,%2+5,%3+2,GUIComboText3 mov byte[GUItextcolor],221 cmp byte[GUIWincoladd],0 je %%zero mov byte[GUItextcolor],222%%zero GUIOuttextwin2 %1,%2+4,%3+1,GUIComboText3%endmacro%macro DrawBorderedBoxB2 7 ; Special function for combo displays ; draw borders mov dl,[GUIWincol] DrawGUIWinBox %1,%2,%6,%4,%3,dl mov dl,[GUIWincol] inc dl DrawGUIWinBox %1,%2-1,%3,%2,%5,dl mov dl,[GUIWincol] add dl,4 DrawGUIWinBox %1,%2,%5,%4,%5+1,dl mov dl,[GUIWincol] add dl,3 DrawGUIWinBox %1,%4,%3,%4+1,%5,dl DrawGUIWinBox %1,%2,%3,%4,%5,167 mov byte[GUIComboText3b+1],%7 mov byte[GUItextcolor],223 GUIOuttextwin2 %1,%2+2,%3+2,GUIComboText3b mov byte[GUItextcolor],221 cmp byte[GUIWincoladd],0 je %%zero mov byte[GUItextcolor],222%%zero GUIOuttextwin2 %1,%2+1,%3+1,GUIComboText3b%endmacro%macro InitTextColor 0 mov al,217 cmp byte[GUIWincoladd],0 je .zero3 mov al,211.zero3 sub al,15 mov [TextColorSp+2],al mov al,[GUIWincol] mov [TextColorSp],al mov al,163 cmp byte[GUIWincoladd],0 je .zero mov al,164 mov byte[GUItextcolor],164.zero mov [TextColorSp+1],al%endmacro%macro GUIOuttextwin2b 4 ; Special, yellow text mov al,[TextColorSp] mov [GUItextcolor],al GUIOuttextwin2 %1,%2,%3,%4 mov al,[TextColorSp+1] mov [GUItextcolor],al GUIOuttextwin2 %1,%2-1,%3-1,%4%endmacro%macro GUIOuttextwin2c 4 ; Boxed, green text mov byte[GUItextcolor],223 push ecx ;Needed for the macro below GUIOuttextwin2 %1,%2,%3,%4 pop ecx mov byte[GUItextcolor],221 cmp byte[GUIWincoladd],0 je %%zero mov byte[GUItextcolor],222%%zero push esi mov esi,%2 dec esi GUIOuttextwin2 %1,esi,%3-1,%4 pop esi%endmacro%macro GUIOuttextwin2d 5 ; Boxed, green text, limited to 5th param push ecx mov ecx,%4 ;Move pointer to text into ecx%%zero cmp byte[ecx],0 ; Check for null in string je %%one inc ecx jmp %%zero%%one push eax mov eax,ecx ; Move pointer to null into eax sub ecx,%5 ; Move ecx pointer back by length to display cmp ecx,%4 jae %%two mov ecx,%4 ; If pointer is before beginning, reset pointer to beginning%%two sub eax,ecx ; Subtract pointer from \0 pointer gives us string length push eax GUIOuttextwin2c %1,%2,%3,ecx pop eax push ebx pop ecx call BlinkCursorCheck cmp ebx,%4 pop ebx jne near %%fixreg inc byte[GUIBlinkCursorLoop] cmp byte[GUIBlinkCursorLoop],30 jne %%four mov byte[GUIBlinkCursorLoop],0 cmp byte[GUIBlinkCursor],' ' je %%three mov byte[GUIBlinkCursor],' ' jmp %%four%%three mov byte[GUIBlinkCursor],'_'%%four imul eax,6 ; 6 pixels add eax,%2 push ecx mov ecx,eax GUIOuttextwin2c %1,ecx,%3,GUIBlinkCursor pop ecx%%fixreg pop eax%endmacro%macro DrawSlideBar 10 DrawSlideBarWin %1,%2,%3+8,%4,%5,%6,%7-16,%8 mov al,[TextColorSp+2] mov [GUItextcolor],al cmp byte[GUICHold],%9 jne .noholda add byte[GUIWincoladd],3.noholda GUIDisplayIconWin %1,%2,%3,GUIIconDataUpArrow cmp byte[GUICHold],%9 jne .noholda2 sub byte[GUIWincoladd],3.noholda2 mov al,[TextColorSp+2] mov [GUItextcolor],al cmp byte[GUICHold],%10 jne .noholdb add byte[GUIWincoladd],3.noholdb GUIDisplayIconWin %1,%2,%3+%7-8,GUIIconDataDownArrow cmp byte[GUICHold],%10 jne .noholdb2 sub byte[GUIWincoladd],3.noholdb2%endmacro%macro DetermineChar 2 cmp al,%1 jne %%control mov al,%2%%control%endmacro; DGUIDisplayDisplayGUILoad: GUIDrawWindowBox 1,GUILoadDisp GUIDisplayText 1,21,166,GUILoadText3%ifdef __MSDOS__ GUIDisplayTextY 1,6,157,GUILoadText2 GUIDisplayText 1,21,182,GUILoadText4%endif GUIDisplayText 1,21,174,GUILoadText5 GUIDisplayText 1,6,16,GUILoadText7 GUIDisplayText 1,161,16,GUILoadText8 GUIDisplayText 1,146,172,GUILoadTextB push ecx push esi xor ecx,ecx mov esi,[ZRomPath].strlenloop cmp byte[esi+ecx],0 je .foundend inc ecx jmp .strlenloop.foundend cmp ecx,39 jb .notoverflow add esi,ecx sub esi,39.notoverflow mov [GUITemp],esi pop esi pop ecx GUIDisplayText 1,6,138,[GUITemp] mov byte[GUItextcolor],202 cmp byte[GUIWincoladd],0 je .text mov byte[GUItextcolor],196.text mov dword[cloadmaxlen],39%ifndef __MSDOS__ cmp dword[GUIcurrentfilewin],0 je near .nodir mov eax,[GUIcurrentdircursloc] add eax,2 shl eax,2 add eax,[d_names] mov eax,[eax] mov [GUITemp],eax GUIOuttextwin2l 1,6,158,[GUITemp] add byte[GUItextcolor],15 GUIOuttextwin2l 1,5,157,[GUITemp] jmp .nofiles.nodir cmp dword[GUIfileentries],0 je near .nofiles mov eax,[GUIcurrentcursloc] cmp eax,[GUIfileentries] jae near .nofiles shl eax,2 add eax,[selected_names] mov eax,[eax] mov [cloadnpos],eax GUIOuttextwin2l 1,6,158,[cloadnpos] add byte[GUItextcolor],15 GUIOuttextwin2l 1,5,157,[cloadnpos].nofiles ; Button%endif mov byte[GUItextcolor],217 cmp byte[GUIWincoladd],0 je .text2 mov byte[GUItextcolor],111.text2 DrawGUIButton 1,186,165,228,176,GUILoadText9,1,0,0 ; The Three Boxes GUIDisplayBBoxS 1,5,25,144,134,167 ; 126 = 6 * 21, 112 = 7 * 16 GUIDisplayBBoxS 1,160,25,228,134,167 ; 78 = 6 * 13 GUIDisplayBBox 1,5,145,228,152,167 ; 126 = 6 * 21, 112 = 7 * 16 xor ebx,ebx ; Flash Code? mov bl,[GUILoadPos] mov byte[GUILoadTextA+ebx],0 test byte[GUILDFlash],8 jnz .nound mov byte[GUILoadTextA+ebx],'_' mov byte[GUILoadTextA+ebx+1],0.nound mov ebx,[GUIcurrentcursloc] ; check if its in the Files box? sub ebx,[GUIcurrentviewloc] cmp dword[GUIcurrentfilewin],0 je .files mov ebx,[GUIcurrentdircursloc] sub ebx,[GUIcurrentdirviewloc].files mov eax,ebx ; Draw 2 more boxes? lea ebx,[ebx*4] add ebx,eax add ebx,eax add ebx,eax add ebx,27 cmp dword[GUIcurrentfilewin],0 jne .dir DrawGUIWinBox2 1,5,144,7,224 jmp .files2.dir DrawGUIWinBox2 1,160,228,7,224.files2 mov byte[GUItextcolor],223 ; Green Shadow GUIOuttextwin2 1,8,148, GUILoadTextA cmp dword[GUIfileentries],0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -