Sha256: 985ed1e1e93fd096ff2ec6a63a5dd79cf4dbf7a5c4d3e554a0c54f03b4d027bb

Contents?: true

Size: 1.46 KB

Versions: 1

Compression:

Stored size: 1.46 KB

Contents

/*
 * wxGridCellAttr.cpp
 *
 *  Created on: 19.04.2012
 *      Author: hanmac
 */

#include "wxApp.hpp"
#include "wxGridCellAttr.hpp"

#include "wxColor.hpp"
#include "wxFont.hpp"

VALUE rb_cWXGridCellAttr;

#if wxUSE_GRID

template <>
VALUE wrap< wxGridCellAttr >(wxGridCellAttr* window)
{
	return wrapTypedPtr(window,rb_cWXGridCellAttr);
}


#define _self unwrap<wxGridCellAttr*>(self)



namespace RubyWX {
namespace GridCellAttr {

macro_attr(TextColour,wxColour)
macro_attr(BackgroundColour,wxColour)
macro_attr(Font,wxFont)

APP_PROTECT(wxGridCellAttr)

}
}

#endif

DLL_LOCAL void Init_WXGridCellAttr(VALUE rb_mWX)
{

#if wxUSE_GRID
	using namespace RubyWX::GridCellAttr;
	rb_cWXGridCellAttr = rb_define_class_under(rb_mWX,"GridCellAttr",rb_cObject);
	rb_define_alloc_func(rb_cWXGridCellAttr,_alloc);

#if 0
	rb_define_attr(rb_cWXGridCellAttr,"text_color",1,1);
	rb_define_attr(rb_cWXGridCellAttr,"background_color",1,1);
	rb_define_attr(rb_cWXGridCellAttr,"font",1,1);
#endif

	//TODO make GridCellAttr copyable
	rb_undef_method(rb_cWXGridCellAttr,"initialize_copy");
	rb_undef_method(rb_cWXGridCellAttr,"_load");
	rb_undef_method(rb_cWXGridCellAttr,"_dump");

	rb_define_attr_method(rb_cWXGridCellAttr,"text_color",_getTextColour,_setTextColour);
	rb_define_attr_method(rb_cWXGridCellAttr,"background_color",_getBackgroundColour,_setBackgroundColour);
	rb_define_attr_method(rb_cWXGridCellAttr,"font",_getFont,_setFont);

	registerType<wxGridCellAttr>(rb_cWXGridCellAttr);
#endif
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rwx-0.0.1.1.dev ext/wxGridCellAttr.cpp