March 29, 2024, 04:42:28 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Tab control - Changing tab name

Started by Andy, January 13, 2021, 09:27:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy

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.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

aurelCB

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

Andy

Aurel to the rescue again!

Thanks Aurel.

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

Andy.
 :)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

aurelCB

Ok i will add source into attachment
then you will have all things in one place
;D OxyEdit.eba

Andy

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.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

aurelCB

January 15, 2021, 06:03:05 AM #5 Last Edit: January 15, 2021, 06:06:06 AM by aurelCB
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  :)

Brian

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

aurelCB

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

aurelCB

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

Brian


aurelCB


h3kt0r

Thank you for sharing your program aurelCB !

aurelCB

No problem
well just to say o2 version is almost identical...