Author Topic: Edit Tabs  (Read 10473 times)

HSE

  • Member
  • *****
  • Posts: 2463
  • AMD 7-32 / i3 10-64
Edit Tabs
« on: November 19, 2015, 03:11:16 AM »
Hi!

Somebody remeber if there is some option to change tabs from singleline to multiline?

Apparently the code admit the 2 options, but I don`t known if was implemeted:
Code: [Select]
test da.win.fView,VIEW_MULTITAB
.if ZERO?
mov edx,WS_VISIBLE or WS_CHILD or WS_CLIPSIBLINGS or WS_CLIPCHILDREN or TCS_FOCUSNEVER or TCS_BUTTONS
.else
mov edx,WS_VISIBLE or WS_CHILD or WS_CLIPSIBLINGS or WS_CLIPCHILDREN or TCS_FOCUSNEVER or TCS_BUTTONS or TCS_MULTILINE
.endif
invoke CreateWindowEx,0,addr szTabControlClassName,NULL,edx,0,0,0,0,ha.hToolTab,0,ha.hInstance,0
mov ha.hTab,eax


Its not a critical issue because there is no problem to modify the code but, I think, important in terms of RADasm software development.

Thanks. HSE
 
Equations in Assembly: SmplMath

ragdog

  • Member
  • ****
  • Posts: 609
Re: Edit Tabs
« Reply #1 on: November 19, 2015, 03:33:17 AM »
Hello Hse

Go in menu Option>> Code editor

you find a option check box "Multiline tabtool" bottom left

Check it and push Apply

HSE

  • Member
  • *****
  • Posts: 2463
  • AMD 7-32 / i3 10-64
Re: Edit Tabs
« Reply #2 on: November 19, 2015, 04:18:06 AM »
Hi Ragdog!!

Perhaps a time ago I try that check box and I don`t see the change, surely I was expecting tab resizing.

Thanks a lot. HSE
Equations in Assembly: SmplMath

ragdog

  • Member
  • ****
  • Posts: 609
Re: Edit Tabs
« Reply #3 on: November 19, 2015, 04:41:53 AM »
Change the size from tab control a little




HSE

  • Member
  • *****
  • Posts: 2463
  • AMD 7-32 / i3 10-64
Re: Edit Tabs
« Reply #4 on: November 19, 2015, 05:40:05 AM »
Yes, thanks. I was thinking in automatic resizing.  It's a task for the future, but the tabcontrol is already subclassed.
Equations in Assembly: SmplMath

HSE

  • Member
  • *****
  • Posts: 2463
  • AMD 7-32 / i3 10-64
Re: Edit Tabs
« Reply #5 on: November 22, 2015, 02:43:42 AM »
Oh, oh! Not so simple: the tab control is in a wrapper, and the wrapper is not controled by his window parent but from a "controler window" through a "docking structure" :icon_eek:.  Apparently this is what allow to move windows without need of MDI.  There is a name for this kind of architecture? And some more explained (and perhaps simple) example?

Thanks. HSE
Equations in Assembly: SmplMath

HSE

  • Member
  • *****
  • Posts: 2463
  • AMD 7-32 / i3 10-64
Re: Edit Tabs
« Reply #6 on: December 02, 2015, 03:08:52 AM »
Hello! Nobody here?

Ok, is a very specific issue  :icon_eek:

I found some other KetilO's examples at https://fbedit.svn.sourceforge.net/svnroot/fbedit/

Interesting thing is that MasmEd (the previous KetilO's IDE) make automatic adjusting of tabs. In developing the new architecture that feature was removed.

Now RadAsm make the adjust (I think a little better than MasmEd), but is semiautomatic because I'm still working in trigger the refresh ( at this moment I need to activate some tool caption).

Regards. HSE 
 
« Last Edit: December 02, 2015, 05:50:09 AM by HSE »
Equations in Assembly: SmplMath

ragdog

  • Member
  • ****
  • Posts: 609
Re: Edit Tabs
« Reply #7 on: December 02, 2015, 06:40:44 AM »
Hello

Ok thanks for the bug Info but is open source to fix it
« Last Edit: December 03, 2015, 05:35:57 AM by ragdog »

ragdog

  • Member
  • ****
  • Posts: 609
Re: Edit Tabs
« Reply #8 on: December 03, 2015, 07:39:51 AM »
Hello

The Tabs Multiline Autosize bug is here it do not update the TabControl to the new size.

Code: [Select]
test da.win.fView,VIEW_MULTITAB
.if ZERO?
mov edx,WS_VISIBLE or WS_CHILD or WS_CLIPSIBLINGS or WS_CLIPCHILDREN or TCS_FOCUSNEVER or TCS_BUTTONS
.else

mov edx,WS_VISIBLE or WS_CHILD or WS_CLIPSIBLINGS or WS_CLIPCHILDREN or TCS_FOCUSNEVER or TCS_BUTTONS or TCS_MULTILINE
.endif
invoke SetWindowLong,ha.hTab,GWL_STYLE,edx
.endif
retn

KeyWordsProc endp


HSE

  • Member
  • *****
  • Posts: 2463
  • AMD 7-32 / i3 10-64
Re: Edit Tabs
« Reply #9 on: December 03, 2015, 10:59:36 PM »
Hi Ragdog!!

I think there is no bug, the feature is just missing.

There is some complications:
1) SysTabControl32 don't autosize
2) KetilO Tool system is mouse driven only
3) It's a complex system:
    a) 3 differente window classes, each one subclassed
    b) 3 additional procedures to manage messages between subclasses
    c) each tool have 7 different RECT structures

I make some changes...

In RATools.lib:

RATools.inc
Code: [Select]

TLT_GENERAL             equ 0       ; <------------------------------ NEW
TLT_CONTROLTAB       equ 1       ; <------------------------------ NEW

TOOL struct
dck DOCKING <>
dr RECT <> ;Docked
wr RECT <> ;Child window
rr RECT <> ;Resize
tr RECT <> ;Top
cr RECT <> ;Caption
br RECT <> ;Close button
dType dd ?        ; <------------------------------ NEW
dFocus dd ?
dCurFlag dd ?
hWin         dd ?
hCld dd ?
        hChild                               dd ?        ; <------------------------------ NEW
lpfnOldCldWndProc dd ?
TOOL ends

Tool.asm
Code: [Select]
.elseif eax==TLM_ADJUSTRECT    ; in ToolMsg proc
.if [esi].TOOL.dType == TLT_CONTROLTAB
invoke SendMessage,[esi].TOOL.hChild, TCM_GETROWCOUNT, FALSE,FALSE
mov renglones , eax
invoke SendMessage,[esi].TOOL.hChild,TCM_GETITEMRECT,0, addr rect2
mov eax , rect2.bottom
add eax , 2
mov ecx , renglones
.if ecx == 0
inc ecx
.endif
mul ecx
mov [esi].TOOL.dck.dHeight, eax
.endif
.if [esi].TOOL.dck.Visible && [esi].TOOL.dck.Docked

In RADasm30:

Tools.asm
Code: [Select]
test da.win.fView,VIEW_MULTITAB
.if ZERO?
mov      eax , ha.hToolTab
call    GetToolPtr
mov [edx].TOOL.dType, TLT_GENERAL
mov edx,WS_VISIBLE or WS_CHILD or WS_CLIPSIBLINGS or WS_CLIPCHILDREN \
or TCS_FOCUSNEVER or TCS_BUTTONS
.else
mov      eax,ha.hToolTab
call    GetToolPtr
mov [edx].TOOL.dType, TLT_CONTROLTAB
mov edx,WS_VISIBLE or WS_CHILD or WS_CLIPSIBLINGS or WS_CLIPCHILDREN \
or TCS_FOCUSNEVER or TCS_BUTTONS or TCS_MULTILINE or \
                                         TCS_RIGHTJUSTIFY

.endif
invoke CreateWindowEx,0,addr szTabControlClassName,NULL,\
                               edx,0,0,0,0,ha.hToolTab,0,ha.hInstance,0
mov ha.hTab,eax

push eax                                        ;  <-----  I forget this little piece
mov eax , ha.hToolTab
invoke GetToolPtr
pop eax   
mov [edx].TOOL.hChild, eax

KeyWord.asm
Code: [Select]
test da.win.fView,VIEW_MULTITAB
.if ZERO?
mov      eax , ha.hToolTab
call    GetToolPtr
mov [edx].TOOL.dType, TLT_GENERAL
mov edx,WS_VISIBLE or WS_CHILD or WS_CLIPSIBLINGS or \
                                              WS_CLIPCHILDREN or TCS_FOCUSNEVER or TCS_BUTTONS
.else
mov      eax , ha.hToolTab
call    GetToolPtr
mov [edx].TOOL.dType, TLT_CONTROLTAB
mov edx,WS_VISIBLE or WS_CHILD or WS_CLIPSIBLINGS or WS_CLIPCHILDREN\
                                               or TCS_FOCUSNEVER or TCS_BUTTONS or TCS_MULTILINE
.endif
invoke SetWindowLong,ha.hTab,GWL_STYLE,edx

After adding or deleting an item (that change tab row number) all the system need to be recalculated. I'm failing in to trigger that action :(, only clicking some caption it's posible until now :biggrin:.

Regards. HSE 
« Last Edit: December 04, 2015, 06:12:03 AM by HSE »
Equations in Assembly: SmplMath

ragdog

  • Member
  • ****
  • Posts: 609
Re: Edit Tabs
« Reply #10 on: December 04, 2015, 04:41:37 AM »
Can you upload a compiled exe?

Thanks

HSE

  • Member
  • *****
  • Posts: 2463
  • AMD 7-32 / i3 10-64
Re: Edit Tabs
« Reply #11 on: December 04, 2015, 06:10:23 AM »
Hi Ragdog!!

I was forgetting some pieces (see previous post).

file updated in http://masm32.com/board/index.php?topic=5980.msg66174#msg66174
« Last Edit: April 09, 2020, 08:25:31 AM by HSE »
Equations in Assembly: SmplMath

ragdog

  • Member
  • ****
  • Posts: 609
Re: Edit Tabs
« Reply #12 on: December 04, 2015, 07:26:05 AM »
Thanks Hse

But i have test it but it not works with Tab autosize if i change in Option>>> CodeEditor>> MultiLine tabs and apply

HSE

  • Member
  • *****
  • Posts: 2463
  • AMD 7-32 / i3 10-64
Re: Edit Tabs
« Reply #13 on: December 04, 2015, 07:47:46 AM »
After that, you need to activate some tool caption with the mouse. That is the problem.

The same is true when adding or deleting files to the editor. Actualization requiere mouse action.
Equations in Assembly: SmplMath

HSE

  • Member
  • *****
  • Posts: 2463
  • AMD 7-32 / i3 10-64
Re: Edit Tabs
« Reply #14 on: December 06, 2015, 12:30:12 AM »
Hi Ragdog!

I found there is some messages to tools from menu.


I used the message to show/hide tools in TabProc (TabTools.asm)

at first:
Code: [Select]
        mov           eax, uMsg
        push           eax

after the default CallBack:
Code: [Select]
mov ebx , eax
pop eax
push ebx
.if eax ==TCM_DELETEITEM || eax == TCM_SETITEM

invoke SendMessage, ha.hTool, TLM_HIDE, 0, ha.hToolTab
invoke SendMessage, ha.hTool, TLM_HIDE, 0, ha.hToolTab

.endif
pop eax


the solution is very ugly, but it's a beginning

file updated in http://masm32.com/board/index.php?topic=5980.msg66174#msg66174
« Last Edit: April 09, 2020, 08:26:22 AM by HSE »
Equations in Assembly: SmplMath