Re: Win32Lib TabItem bug

new topic     » goto parent     » topic index » view thread      » older message » newer message
gbonvehi said...

Hi all, I was creating some tabitems dynamically on runtime when I realized that after 5 tab items were created, the others weren't added at the end, but after the 4th tabitem. Looking around I found this things:

In win32lib.ew:

createEx calls:

	createTabItem( id, pCaption, pOwner, pLeft, exFlags ) 

pLeft there is the X coord of the item. That parameter is used by createTabItem to determine the index of the created item as we can see below.

createTabItem signature:

	procedure createTabItem( integer id, sequence caption, integer pOwner,integer tabNumber,integer imgIndex) 

The bogus lines, i guess...

        numItems = length( ctrl_Specific[ pOwner ] ) 
        -- get tab index 
        if tabNumber <= 0 or tabNumber > numItems+1 then 
           tabNumber = numItems 
        else 
           tabNumber -= 1 
        end if 

I've just replaced those lines with tabNumber = numItems to temporarily solve my problem, but the user should be able to specify where to insert the tabitem, and that shouldn't be on the left position parameter (which I guess it should always be 0 since it's viewport position is 0,0 inside it's TabControl owner).

If you use the latest version of win32lib, check the documentation for crate(): it tells you how to specify at which point a tab item is to be inserted.

CChris

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu