Background image in XPBMENU() and in DCSTATIC
- obelix
- Posts: 48
- Joined: Tue Dec 03, 2013 7:44 am
- Location: Villingen-Schwenningen, Black Forest, Germany
Background image in XPBMENU() and in DCSTATIC
Hi everybody,
I would like to to fill a window painted by XPBMENU() with an image in the background
and in a DCSTATIC window too.
Merry Christmas to alle Users
I would like to to fill a window painted by XPBMENU() with an image in the background
and in a DCSTATIC window too.
Merry Christmas to alle Users
quiet old but still young and unskilled in express++
Re: Background image in XPBMENU() and in DCSTATIC
hi,
you can use Ownerdraw Menu to use Icon+Text+Gradient (Red Area)
you can use Ownerdraw MenuBar to "paint" Text or Gradient or Image (Green Area) have a nice Xmas
you can´t modify normal XbpMenu() while "painting" is done by OS()obelix wrote:I would like to to fill a window painted by XPBMENU() with an image in the background
and in a DCSTATIC window too.
you can use Ownerdraw Menu to use Icon+Text+Gradient (Red Area)
you can use Ownerdraw MenuBar to "paint" Text or Gradient or Image (Green Area) have a nice Xmas
greetings by OHR
Jimmy
Jimmy
Re: Background image in XPBMENU() and in DCSTATIC
I don't quite understand what you are wanting but I suspect that it can be done with owner drawing.
The eXpress train is coming - and it has more cars.
- obelix
- Posts: 48
- Joined: Tue Dec 03, 2013 7:44 am
- Location: Villingen-Schwenningen, Black Forest, Germany
Re: Background image in XPBMENU() and in DCSTATIC
Hi Jimmy and Roger,
It just like the example, Jimmy demonstrated. Can you give me a little help for doing it with owner drawing or an example in xdemo or in the samples?
Thanks
Peter
It just like the example, Jimmy demonstrated. Can you give me a little help for doing it with owner drawing or an example in xdemo or in the samples?
Thanks
Peter
quiet old but still young and unskilled in express++
Re: Background image in XPBMENU() and in DCSTATIC
use Source from C:\ALASKA\XPPW32\Source\samples\basics\OWNERDRWobelix wrote:It just like the example, Jimmy demonstrated.
in Demo Sample C:\ALASKA\XPPW32\Source\samples\basics\OWNERDRW\OWNERDRW.prg you will find this Code
Code: Select all
oMbar := oDlg:menuBar()
oMbar:measureItem := {|nItem,aDims,self| MeasureMenubarItem(oDlg,self,nItem,aDims) }
oMbar:drawItem := {|oPS,aInfo,self | DrawMenubarItem(oDlg,self,oPS,aInfo) }
Code: Select all
PROCEDURE AppMenu( oMain )
LOCAL oMenuBar := oMain:menuBar()
LOCAL oLogo := XbpBitmap():new():create()
oLogo:load(,201)
oMenuBar:measureItem := {|nItem,aDims,oSelf| MeasureMenubarItem(oMain,oSelf,nItem,aDims) }
oMenuBar:drawItem := {|oPS,aInfo,oSelf | DrawMenubarItem(oMain,oSelf,oPS,aInfo,oLogo) }
Code: Select all
CLASS MyMenu FROM XbpMenu
...
FUNCTION DrawMenubarItem( oDlg, oMbar, oPS, aInfo, oLogo ) // add oLogo
...
LOCAL nMax := oMbar:numItems()
LOCAL nGraWide := oPS:SetPageSize()[1][1]
IF BAND( aInfo[ 2 ], XBP_DRAWACTION_DRAWALL ) != 0 .AND. aInfo[ 1 ] = nMax
oLogo:draw( oPS, { aInfo[4][3], aInfo[4][2], nGraWide, aInfo[4][4] },,,GRA_BLT_BBO_IGNORE )
ENDIF
greetings by OHR
Jimmy
Jimmy
- obelix
- Posts: 48
- Joined: Tue Dec 03, 2013 7:44 am
- Location: Villingen-Schwenningen, Black Forest, Germany
Re: Background image in XPBMENU() and in DCSTATIC
Thank you Jimmy, I'll try it next week an I will give your feedback.
quiet old but still young and unskilled in express++
Re: Background image in XPBMENU() and in DCSTATIC
If you must have this, it would be best if I just added it as a feature to dcmenu, especially since it alrEady supports owner drawing.
The eXpress train is coming - and it has more cars.
-
- Posts: 481
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: Background image in XPBMENU() and in DCSTATIC
Hi Roger,
if you change the menu ownerdrawing, can you add a ITEMHEIGHT <pixel> and a ICONSIZE <pixel>, so that the height of an item is calculated by the fontsize + itemheight ? Would be a nice feature for ownerdrawing menus.
if you change the menu ownerdrawing, can you add a ITEMHEIGHT <pixel> and a ICONSIZE <pixel>, so that the height of an item is calculated by the fontsize + itemheight ? Would be a nice feature for ownerdrawing menus.
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
Re: Background image in XPBMENU() and in DCSTATIC
Hi Jimmy.
Can you post the prg sample of "OD_Menu.JPG"
This menu have a nice gradient style.
Thanks
Pedro
Can you post the prg sample of "OD_Menu.JPG"
This menu have a nice gradient style.
Thanks
Pedro
Pedro Alexandre
Re: Background image in XPBMENU() and in DCSTATIC
I am still not understanding what you want.
If a logo graphic is used as a background, then the menu items may be hard to read.
Why do you need this?
If a logo graphic is used as a background, then the menu items may be hard to read.
Why do you need this?
The eXpress train is coming - and it has more cars.