Page 1 of 1

HPW Utility Tab Control

PostPosted: Sat Sep 28, 2013 2:52 pm
by ebear
Dear Hans-Peter,

I'm using hpwUtility to create Tabs in my project. The tab-control is working perfect, but I have a little problem with images in the Tabs.
If I use your [1] - [2] - [3] png images from the sample it fine, but if I use some others it looks like the images are placed over each other (First tab is fine, second tab has the images from the first tab below the second tab image etc.)
Second problem is that the images I use are transparent, but if I use them in tab-control they have a white background.

Are there special specs for the png images?

Best regards,

Eric

Re: HPW Utility Tab Control

PostPosted: Sat Sep 28, 2013 10:35 pm
by HPW
Hello,

Hard to tell without your code.
So post the code lines where you config the Images.

And be aware that there is no Support for the defined transparency of a png file.
(This would need to write the Bitmap with 32bit color deep and alpha channel support, currently it is 24 only)
The png is readed like any other of the supported Bitmap formats.

Have you set:

hpwUtilitySetvar "[hpwTabControlImgMaskColor]" "clRed"

When set this key-Color is used as the Color to detect transparent areas.
(When not set the bottom left Pixel is used)(when i remember correctly)

Regards

Re: HPW Utility Tab Control

PostPosted: Sun Sep 29, 2013 3:31 am
by ebear
Hello Hans-Peter,

See below my code,

Code: Select all
hpwUtilitySetVar "[hpwTabControlFontSize]" "16"
hpwUtilitySetVar "[hpwTabControlFontName]" "Calibri"
hpwUtilitySetVar "[hpwTabControlImageList]" "[PubDir]1.png|[PubDir]2.png|[PubDir]3.png|[PubDir]4.png|[PubDir]5.png"
hpwTabControlCreate "Tab" "[_P100]|[_P200]|[_P300]|[_P400]|[_P500]" "tpTop" "tsTabs" "" "" "1" "GoSub [#34]P000_TabChange[#34]"


If I use your 1, 2 , 3 png images everything is ok. When i use my png images the problem accrues, without changing anything on the code.

I will try your instructions for the
Code: Select all
hpwUtilitySetvar "[hpwTabControlImgMaskColor]" "clRed"


I will let know...

Thanks a lot so far,

Eric

Re: HPW Utility Tab Control

PostPosted: Sun Sep 29, 2013 12:30 pm
by ebear
Hello Hans-Peter,

I wanted to use TabControl to replace the buttons I have now in my project. I tried your advice but the images are repeating on the Tabs. (1st tab is ok, 2nd tab has the chosen image and the image of the first tab in background, 3th tab has the image of the 1st and the 2nd tab in the background etc.) see also image.

Image

Im now using the following code:

Code: Select all
hpwUtilitySetVar "[hpwTabControlFontSize]" "16"
hpwUtilitySetVar "[hpwTabControlFontName]" "Calibri"
hpwUtilitySetVar "[hpwTabControlImageList]" "[PubDir]1.png|[PubDir]2.png|[PubDir]3.png|[PubDir]4.png|[PubDir]5.png"
hpwUtilitySetvar "[hpwTabControlImgMaskColor]" "clRed"
hpwTabControlCreate "Tab" "[_P100]|[_P200]|[_P300]|[_P400]|[_P500]" "tpTop" "tsTabs" "" "50" "1" "GoSub [#34]P000_TabChange[#34]"


The tabs are generated on the MasterPage and visible in all the pages:

Code: Select all
:P000_TabChange
   DisableObject "Tab"
   If "[Tab_TabIndex]" "=" "1"
       GotoPage "P100"
   EndIf
   If "[Tab_TabIndex]" "=" "2"
       GotoPage "P200"
   EndIf
   If "[Tab_TabIndex]" "=" "3"
       GotoPage "P300"
   EndIf
   If "[Tab_TabIndex]" "=" "4"
       GotoPage "P400"
   EndIf
   If "[Tab_TabIndex]" "=" "5"
       GotoPage "P500"
   EndIf
   EnableObject "Tab"
Return


Any idea whats going wrong.

Its not that important I can stay at the buttons I have now in the project, but I like the tabs...

Best regards,

Eric

Re: HPW Utility Tab Control

PostPosted: Mon Sep 30, 2013 1:42 am
by HPW
Hello,

Can you post or send your tab images, so I can try to reproduce the problem?

Regards

Re: HPW Utility Tab Control

PostPosted: Mon Sep 30, 2013 11:45 am
by ebear
Hello Hans Peter,

I'm new to dropbox so I hope this link will be accessible for you. In the zip you will find the icons I used in the image.

Best regards, and thanks for your kind support.

Eric

https://www.dropbox.com/s/o25wq7wmz23tqbe/Icons.zip

Re: HPW Utility Tab Control

PostPosted: Mon Sep 30, 2013 1:29 pm
by HPW
I can reproduce what you see, and it come from your PNG files.
What did you use to create them? NeoPaint 5?

Anyway, they are 32 bit PNG.
I opened them either in neopaint 4.7c od neopaint 5.1.1 and convert them to 24 bit PNG.
Then both sets load fine. The only thing I note that neopiant 4 converts the background to black and neopaint 5 convert it to white.

So I used:
hpwUtilitySetVar "[hpwTabControlImgMaskColor]" "clBlack"
or
hpwUtilitySetVar "[hpwTabControlImgMaskColor]" "clWhite"

So fact: TabControl does not support 32 bit PNG's.

Regards

Re: HPW Utility Tab Control

PostPosted: Tue Oct 01, 2013 1:41 am
by ebear
Hello Hans Peter,

Exactly this was the whole problem. Convert to 24bit and use (in my case) hpwUtilitySetVar "[hpwTabControlImgMaskColor]" "clBlack".
And... everything works.

Great, thanks a lot for your time to support me.

Best regards,

Eric

Re: HPW Utility Tab Control

PostPosted: Tue Oct 01, 2013 1:26 pm
by ebear
Hello Hans Peter,

Yet another question:

My main tabs, to switch between the pages are on the master page. Now I have also another tab control in one of my pages. The tabs are working fine but the images of the Tabcontrol in the master page are shown in the addition tabs.
Can I use more tab controls in one project, if yes what is going wrong with the images?

Thanks,

Eric


Sorry I found already the answer: Place an hpwUtilitySetVar "[hpwTabControlImageList]" "" in the code of the additional TabControl code.

Code: Select all
hpwUtilitySetVar "[hpwTabControlFontSize]" "12"
hpwUtilitySetVar "[hpwTabControlFontName]" "Arial"
hpwUtilitySetVar "[hpwTabControlScaled]" "1"
hpwUtilitySetVar "[hpwTabControlImageList]" ""
hpwTabControlCreate "P500_Tab_Rectangle" "By Order|By S/N" "tpTop" "tsTabs" "" "" "" "GoSub [#34]P500_TabChange[#34]"


Regards,

Eric