DCMENU

This forum is for eXpress++ general support.
Post Reply
Message
Author
Wolfgang Ciriack
Posts: 484
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

DCMENU

#1 Post by Wolfgang Ciriack »

Hi Roger,
Maybe the best thing is for you to write your own owner-drawing system using SUBCLASS, like Tom Liehr does with the browse system.
I don't see SUBCLASS in the dcdialog.ch for DCMENU...
How can I subclass the DCMENUITEM for changing the :measureitem function in ownerdraw menus ?
_______________________
Best Regards
Wolfgang

Wolfgang Ciriack
Posts: 484
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: DCMENU

#2 Post by Wolfgang Ciriack »

Hi Roger,
is subclassing for DCMENUITEMS implemented ?
_______________________
Best Regards
Wolfgang

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCMENU

#3 Post by rdonnay »

It looks like it is not implemented.

I will work on this.
The eXpress train is coming - and it has more cars.

Wolfgang Ciriack
Posts: 484
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: DCMENU

#4 Post by Wolfgang Ciriack »

Thank you.
_______________________
Best Regards
Wolfgang

User avatar
Auge_Ohr
Posts: 1428
Joined: Wed Feb 24, 2010 3:44 pm

Re: DCMENU

#5 Post by Auge_Ohr »

Wolfgang Ciriack wrote:How can I subclass the DCMENUITEM for changing the :measureitem function in ownerdraw menus ?
as i know o:measureItem work only once while XBPMENUBAR_MIA_OWNERDRAW ( no Advance ) is used in Methode addItem() by Alaska.


for my native Controls i use this Code with ot4xb

Code: Select all

   ::oMeasureitemstruct    := MEASUREITEMSTRUCT():NEW()
   ::oMeasureitemstruct:_link_(lp,.F.)
//
// Member of MEASUREITEMSTRUCT()
//
   nCtlType    := ::oMeasureitemstruct:CtlType
   nCtlID      := ::oMeasureitemstruct:CtlID
   nitemID     := ::oMeasureitemstruct:itemID
   nWidth      := ::oMeasureitemstruct:itemWidth
   nHeight     := ::oMeasureitemstruct:itemHeight
   nitemData   := ::oMeasureitemstruct:itemData

   IF ::oMeasureitemstruct:itemID == -1
      RETURN
   ENDIF
   //
   // use Xbase++ Codeblock
   //
      IF VALTYPE( ::MeasureItem ) == "B"

         ::aDims := { ::oMeasureitemstruct:itemWidth ,;
                      ::oMeasureitemstruct:itemHeight  }

         aOld  := ACLONE(::aDims)
         //
         // now "send" it to Xbase++
         //
         EVAL( ::MeasureItem, ::oMeasureitemstruct:itemID , ::aDims , Self)

         //
         // after EVAL() if aDims have change "write" back to Structur
         //
         IF aOld[1] <> ::aDims[1]
            ::oMeasureitemstruct:itemWidth  := ::aDims[1]
         IF aOld[2] <> ::aDims[2]
            ::oMeasureitemstruct:itemHeight := ::aDims[2]
         ENDIF
         RETURN

      ENDIF
   ...
perhaps you can try to modify Measureitem Structur this Way.
greetings by OHR
Jimmy

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCMENU

#6 Post by rdonnay »

I added sub-classing capability to DC_XbpMenu() and DC_XbpMenuBar().

Copy the attached _DCGETBX.PRG file to \exp19\source\dclipx and run BUILD19_SL1.BAT to rebuild DCLIPX.DLL.
Attachments
_dcgetbx.zip
(86.8 KiB) Downloaded 650 times
The eXpress train is coming - and it has more cars.

Post Reply