Right,some sizing symbol.I added closing symbol 'X' as arrow 4, so sizing symbol would be as arrow 5 (ascii or drawn double broken line ( like diagonal half edged arrow ) or drawn overlapped symbols '>' and '<')What you want implant? A sizing symbol?
Arrow 4+5 temporarily placed among arrows, but seems as logical choice for me.
"X" and "\" are necessary symbols for closing & resizing widgets.Last maybe arrow 6 as maximize symbol.
Needed parts for resizing MLeditBox are:
- to add Resize symbol - Done. ("X" just for testing)
- to get it working - Not working after clicking it
- detect mouse in move by variable 'mouseMoved'
- detect LMB pressed, holded
- when detected this => composed gadget resized, updated, redrawn.
added code
Code: Select all
function AddMultiLineEditBox(...)
function=0
dim as Gadget ptr gad,editbox, arrowResize
(...)
if gad->subevent then
editbox=AddMLEBGadget(gad->subevent,PosX,PosY,BoxWidth-15,BoxHeight-15,DisplayMode)
AddScrollBar(gad->subevent,PosX+BoxWidth-15,PosY,BoxHeight-15,1,1,1,NumRows,1)
AddScrollBar(gad->subevent,PosX,PosY+BoxHeight-15,BoxWidth-15,1,1,1,NumChars,0)
arrowResize= AddArrow(gad->subevent,PosX+BoxWidth-15,PosY+BoxHeight-15,4) 'my
(...)
Code: Select all
function MultiLineEditActions(gad as Gadget ptr,action as integer) as integer
function=0
dim as Gadget ptr editbox,vscrollbar,hscrollbar, arrowResize
editbox=gad->subevent->GadgetList->GetFirst
vscrollbar=cast(Gadget ptr,editbox->next_node)
hscrollbar=cast(Gadget ptr,vscrollbar->next_node)
arrowResize= ?? ' how looks callback ??
(...)
Code: Select all
sub MultiLineEditSubHandle(gad as Gadget ptr)
dim as Gadget ptr editbox,vscrollbar,hscrollbar, arrowResize
editbox=gad->subevent->GadgetList->GetFirst
vscrollbar=cast(Gadget ptr,editbox->next_node)
hscrollbar=cast(Gadget ptr,vscrollbar->next_node)
arrowResize= ?? ' how looks callback ??
'gad->subevent->xSleep(-1,0)' ein Event der als "Durchläufer" und ohne SLEEP funktioniert!!!!!!!!!!!!!!!!
gad->subevent->LMBGadgetCheck
if gad->subevent->GADGETMESSAGE then
select case gad->subevent->GADGETMESSAGE
case editbox
ModifyScrollBar(vscrollbar,1,TO_GetLines(gad),TraceCursorLine(editbox))
ModifyScrollBar(hscrollbar,TraceCursorPosition(editbox))
case vscrollbar
VScrollMLEB(editbox,GetScrollBarVal(vscrollbar))
case hscrollbar
HScrollMLEB(editbox,GetScrollBarVal(hscrollbar))
case arrowResize 'detect resizing&mouse in move
? "ooo" 'testing
end select
DrawGadget(editbox)
end if
end sub
Seems as right place for resizing detecting.