IonicWind Software

IWBasic => General Questions => Topic started by: Andy on January 13, 2021, 09:27:41 AM

Title: Tab control - Changing tab name
Post by: Andy on January 13, 2021, 09:27:41 AM
Hi,

Well in one week I've managed to change the editor from using buttons for tabs to an actual tab control.

All file operations are done (open, save, close etc) except the "Save As..." option.

I could just delete the tab in question and add a new one with the new file name, but it would be nice to actually rename it instead.

I can't use the IWB set tab text command as it has a fault in it.

So, I'm left with the API command to do it, however I am struggling to understand
the TCITEM structure and how to implement a tab name change.

Has anyone done this? if so a little example / help would be greatly appreciated!

Thanks,
Andy.
Title: Re: Tab control - Changing tab name
Post by: aurelCB on January 13, 2021, 11:05:28 AM
Andy 
You have all that in OxyEdit ...did you looked

SUB SetTabText(hWnd:window,cntID:int,index:int,text:string)
DEF tie:TC_ITEM
tie.mask=TCIF_TEXT
tie.pszText=text
tie.cchTextMax=len(text)
tie.iImage=-1
SendMessage(hwnd,TCM_SETITEM,index,&tie,cntID)
return
ENDSUB
Title: Re: Tab control - Changing tab name
Post by: Andy on January 14, 2021, 04:35:00 AM
Aurel to the rescue again!

Thanks Aurel.

I have tried to download your editor but it just says file 404 (page not found).

Andy.
 :)
Title: Re: Tab control - Changing tab name
Post by: aurelCB on January 14, 2021, 09:18:05 AM
Ok i will add source into attachment
then you will have all things in one place
;D OxyEdit.eba
Title: Re: Tab control - Changing tab name
Post by: Andy on January 15, 2021, 04:32:27 AM
Aurel,

Sorry for the late reply, I didn't see the post.

Thanks for sharing that, I will have a good look through.

Thanks again,
Andy.
Title: Re: Tab control - Changing tab name
Post by: aurelCB on January 15, 2021, 06:03:05 AM
Hi Andy

no problem...editor as is is almost complete
i am using it in my o2 programming all the time
to compile it i use Ebasic
you also need scilexer.dll
in my version i am using old 1.6.8.0
but also work with newer
3.1.1.0 without problem...
you also need to add toolbar bitmap
if you dont have  i can send you...

what i forget to add is current line storage ,require just a array of integers
also would be nice to have message box question Yes,Cancel,No when closing tab
i mean with question " Would you like to save file?" 
Autosave is built in when swiching between tabs.

all best
Aurel  :)
Title: Re: Tab control - Changing tab name
Post by: Brian on January 15, 2021, 06:16:29 AM
Aurel,

I compiled it with IWB and the scilexer, no problem. Be nice to see the toolbar. But when it runs, it just hangs, and you can't close it. You have to end task to do that. Still looking . . .

Brian
Title: Re: Tab control - Changing tab name
Post by: aurelCB on January 15, 2021, 07:55:58 AM
Yes Brian you have a right 
that is left from my old AurelBasic interpreter
just remove this two subroutines with w2- window type

code :
'////NEW WINDOW /////////////////////////////////////////////////////////
SUB newwindow

'caption of window

'open new window ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

OPENWINDOW w2,0,0,400,300,@minbox,0,"Magic Small",&mainsub


',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
'Setfocus w2
'form = 1

'If form=1 then return

'waituntil w2=0
'Gosub resetvars

RETURN
ENDSUB


'****************************************************************
SUB mainsub

IF @CLASS = @IDCLOSEWINDOW
'  closes the window and sets w1 = 0
CLOSEWINDOW w2
ENDIF

IF @class = @IDcreate
Centerwindow w2
Endif

RETURN
ENDSUB
Title: Re: Tab control - Changing tab name
Post by: aurelCB on January 15, 2021, 08:07:23 AM
Wow i even forgot when was made it
2011...how time goes...

in attachment is a small toolbar bitmap ,yes it is small just 16 pixel high  heh
but at that time i still use Xp...i think  ::)

OxyEdit2011.png
Title: Re: Tab control - Changing tab name
Post by: Brian on January 15, 2021, 08:38:14 AM
Working now - thanks, Aurel

Brian
Title: Re: Tab control - Changing tab name
Post by: aurelCB on January 15, 2021, 09:57:04 AM
OK Brian  ;)
Title: Re: Tab control - Changing tab name
Post by: h3kt0r on January 19, 2021, 06:54:16 PM
Thank you for sharing your program aurelCB !
Title: Re: Tab control - Changing tab name
Post by: aurelCB on January 20, 2021, 02:50:26 PM
No problem
well just to say o2 version is almost identical...