On 29 July 2011 21:49, Dave Tapley <dukedave@gmail.com> wrote:
Hi Jeremy,

Did you ever make a start wrapping wxPropertyGrid?
http://permalink.gmane.org/gmane.comp.lang.haskell.wxhaskell.general/1016

I'm going to have a go now.

Dave,

In my quest to understand how a class from wxWidgets is wrapped I took at look at wxSlider as it shares the same class hierarchy as wxPropertyGrid and 'slider' is a fairly distinct term.

Searching for 'slider' in the wxHaskell code I extracted the following references to it.
Does this look complete? If anyone could comment further on what function each part provides I'd be very grateful.


# HAND-WRITTEN FILES #

./wx/src/Graphics/UI/WX/Controls.hs:
Haskell impl

./wxcore/src/eiffel/wx_defs.e:
Eiffel alias for wxEVT_COMMAND_SLIDER_UPDATED as expEVT_COMMAND_SLIDER_UPDATED

./wxcore/src/include/wxc.h:
TClassDefExtend saying wxSlider95 and wxSliderMSW are wxSlider

./wxcore/src/include/wxc_glue.h:
Decl of int expEVT_COMMAND_SLIDER_UPDATED();
TClassDefExtend saying wxSlider is a wxControl
Decl of many wxSlider_ methods such as wxSlider_ClearSel
Decl of wxXmlResource_GetSlider method

./wxcore/src/haskell/Graphics/UI/WXCore/Layout.hs:
This code is commented out

./wxcore/src/haskell/Graphics/UI/WXCore/Events.hs:
Exports sliderOnCommand, sliderGetOnCommand
Def for sliderOnCommand which sends wxEVT_COMMAND_SLIDER_UPDATED and take an eventHandler
Def for sliderGetOnCommand which returns the event handler

./wxcore/src/cpp/extra.cpp:
ifdef wxUSE_SLIDER  wxT("SLIDER")

./wxcore/src/cpp/eljslider.cpp:
EWXWEXPORT calls for all the wxSlider_ methods decl'd in wxc_glue.h

./wxcore/src/cpp/eljrc.cpp:
BUILD_XRCGETCTRL_FN(Slider) (constructs functions for geting control pointers out of window hierarchies created from XRC files. The functions themselves)

./wxcore/src/cpp/defs.cpp:EWXWCONSTANTINT(wxEVT_COMMAND_SLIDER_UPDATED,wxEVT_COMMAND_SLIDER_UPDATED)

./wxcore/src/cpp/eljevent.cpp:
MAKE_EVENT_WRAPPER(EVT_COMMAND_SLIDER_UPDATED)


# MISC FILES #

./wxcore/wxcore.cabal:
    add src/cpp/eljslider.cpp to c-sources

./samples/test/XRCControls/XRCControls_Wx.hs:
    test code for xrc


# GENERATED FILES #

./wxcore/src/haskell/Graphics/UI/WXCore/WxcClassesMZ.hs:
File generated by wxDirect from ./wxcore/src/include/wxc.h:
Export of (wxEVT_COMMAND_SLIDER_UPDATED :: EventId)
Export of many slider functions such as sliderClearSel, these match the wxSlider_ methods decl'd in wxc_glue.h
Export of xmlResourceGetSlider function decl'd in wxc_glue.h
Definition for slider functions using FFI foreign import ccall
Definition of wxEVT_COMMAND_SLIDER_UPDATED which imports the enum value
Definition of xmlResourceGetSlider using FFI foreign import ccall

./wxcore/src/haskell/Graphics/UI/WXCore/WxcClassInfo.hs:
File generated by wxDirect
Export of classSlider, classSlider95, classSliderMSW
Export of downcastSlider, downcastSlider95, downcastSliderMSW
Definition classSlider functions which bind them to the their C++ class names using a classInfoFindClass function
Definition of downcast functions using an objectCast function

./wxcore/src/haskell/Graphics/UI/WXCore/WxcClassTypes.hs:
File generated by wxDirect from ./wxcore/src/include/wxc.h:
Exports Slider, TSlider, CSlider, and 95 and MSW variants
Definitions of these as data types, encapsulating the class hierarchy from C++ classes. TSlider is the inheritance type, CSlider is the abstract type.