while browsing through the Sources

Started by drizz, May 05, 2007, 11:47:33 PM

Previous topic - Next topic

drizz

Hi KetilO,

while browsing through the recently released Sources
i added a few things, so i tought why not post about them
and see if i wrote it all right.


- Double click on tab to close it

Tools\Tools.asm - ToolCldWndProc

.elseif eax==WM_LBUTTONDBLCLK
mov eax, hWin
.if eax==hTab
invoke GetCursorPos,addr tch.pt
invoke GetClientRect,hTab,addr rect
invoke ClientToScreen,hWin,addr rect
mov eax,rect.left
sub tch.pt.x,eax
mov eax,rect.top
sub tch.pt.y,eax
invoke SendMessage,hTab,TCM_HITTEST,0,addr tch
; get tab that was dblclicked
.if eax != -1
push eax
invoke SendMessage,hTab,TCM_GETCURSEL,0,0
pop edx
; is tab that was dblclicked also selected?
.if eax == edx
invoke SendMessage,hMdiCld,WM_CLOSE,0,0
.endif
.endif
.else
invoke SendMessage,hWnd,WM_TOOLDBLCLICK,hWin,lParam
.endif
xor eax,eax
ret



- Close All But Current - window option

;added menu item to "Menus\MdiMenu.mnu"
IDM_WINDOW_CLOSEALLBUT   equ 44032;***

Mdi\MdiRadAsm.asm - CmdWindow

.elseif eax==IDM_WINDOW_CLOSEALLBUT
push esi
push edi
invoke SendMessage,hClient,WM_MDIGETACTIVE,0,0
mov esi,eax; get active mdi handle in esi
invoke SendMessage,hClient,WM_MDINEXT,NULL,0; go to next
  @@:
invoke SendMessage,hClient,WM_MDIGETACTIVE,0,0
.if eax && eax != esi
mov edi,eax
invoke SendMessage,edi,WM_SETFOCUS,0,0
invoke SendMessage,edi,WM_CLOSE,0,0
or      eax,eax
je @B
.endif
pop edi
pop esi


- Project description can be blank - defaults to Project name

Wiz\Wizzard.asm - DialogFunc1 - WM_NOTIFY

.if eax==PSN_SETACTIVE ; page gaining focus
invoke SetParentCaption,hWin
invoke GetDlgItemText,hWin,IDD_PN,addr buffer,128
.if eax
mov eax,PSWIZB_NEXT
.endif
xor edx,edx
invoke PostMessage,hWiz,PSM_SETWIZBUTTONS,edx,eax

Wiz\Wizzard.asm - DialogFunc1 - WM_COMMAND

.elseif eax==IDD_PN || eax==IDD_PD
mov eax,wParam
shr eax,16

.if eax==EN_CHANGE
invoke GetDlgItemText,hWin,IDD_PN,addr buffer,128
.if eax
mov eax,PSWIZB_NEXT
.endif
xor edx,edx
invoke PostMessage,hWiz,PSM_SETWIZBUTTONS,edx,eax
.endif

Wiz\Wizzard.asm - ProWizFinish

;Write project description to project file
invoke GetDlgItemText,hWin,IDD_PD,addr buffer,sizeof buffer
.if !eax
invoke GetDlgItemText,hWin,IDD_PN,addr buffer,sizeof buffer
.endif



and some eyecandy - Res\MdiTbr.bmp

[attachment deleted by admin]
The truth cannot be learned ... it can only be recognized.

KetilO

Thanks drizz

Works great. :U
Will be included in next release.

KetilO