1. Enhancement request for wxEuphoria

I do not know if this fits the design philosophy of wxEuphoria, but this enhancement would greatly increase the usability of it, by allowing Cairo support. The main reason I use Cairo is to take advantage of being able to draw bezier curves. The main reason why most people use it is because it provides what is called anti aliasing. That means graphics appear smooth to the eye. Anyway, after much research online I found this from this site:

http://code.google.com/p/wxcairo/wiki/IntegratingWithCairo#Rendering_with_GTK

It is written in C + + unfortunately (I hate that language.)

 
#include <gdk/gdk.h> 
#include <gtk/gtk.h> 
#include <cairo.h> 
 
void MyClass::OnPaint(wxPaintEvent &WXUNUSED(event)) 
{ 
    wxPaintDC dc(this); 
     
    wxRect rect = GetClientRect(); 
     
    if(rect.width == 0 || rect.height == 0) 
    { 
        return; 
    } 
 
    // If it's GTK then use the gdk_cairo_create() method. The GdkDrawable object 
    // is stored in m_window of the wxPaintDC. 
    cairo_t* cairo_image = gdk_cairo_create(dc.m_window); 
    Render(cairo_image, rect.width, rect.height); 
    cairo_destroy(cairo_image); 
} 
 

The part I am requesting from wxEuphoria is to expose the dc.m_window - have a simple function which given the dc would return the m_window. If you think you should do more, that is okay. But I do need Cairo. I got this idea by looking at wxGraphics.cpp in the source for wxEuphoria.

Thanks.

new topic     » topic index » view message » categorize

2. Re: Enhancement request for wxEuphoria

penpal0andrew said...

The part I am requesting from wxEuphoria is to expose the dc.m_window - have a simple function which given the dc would return the m_window. If you think you should do more, that is okay. But I do need Cairo. I got this idea by looking at wxGraphics.cpp in the source for wxEuphoria.

OK, that looks like a GTK thing. I've wrapped it as get_dc_gdk_window(). I recommend checking out the code from svn and re-building. Let me know if that's what you want. Also, I'm hoping to release v0.15.0, so if there is anything else you know that needs wrapping, let me know.

Matt

new topic     » goto parent     » topic index » view message » categorize

3. Re: Enhancement request for wxEuphoria

A big one, but wxPropertyGrid would be nice to have
also wxFoldbar (deprecated ?)
and wxCollapsiblePanel

new topic     » goto parent     » topic index » view message » categorize

4. Re: Enhancement request for wxEuphoria

raseu said...

A big one, but wxPropertyGrid would be nice to have
also wxFoldbar (deprecated ?)
and wxCollapsiblePanel

wxPropertyGrid does not appear to be in 2.8 (which is what wxEuphoria is currently based upon).

I don't see anything about wxFoldbar either.

I see wxCollapsiblePane. That does look interesting.

Matt

new topic     » goto parent     » topic index » view message » categorize

5. Re: Enhancement request for wxEuphoria

raseu said...

A big one, but wxPropertyGrid would be nice to have
also wxFoldbar (deprecated ?)
and wxCollapsiblePanel

I've just committed wrapers to wxCollapsiblePanel into svn.

Matt

new topic     » goto parent     » topic index » view message » categorize

6. Re: Enhancement request for wxEuphoria

excellent!

new topic     » goto parent     » topic index » view message » categorize

7. Re: Enhancement request for wxEuphoria

mattlewis said...

wxPropertyGrid does not appear to be in 2.8 (which is what wxEuphoria is currently based upon).

I don't see anything about wxFoldbar either.

I see wxCollapsiblePane. That does look interesting.

I've used a wxGrid before to simulate a basic property grid. Basically, create one column for your "values" and set the row header to each "property" name. You can even adjust the cell editors as necessary (combobox, etc.) for the full effect. smile Only feature I never got down was property grouping. sad

-Greg

new topic     » goto parent     » topic index » view message » categorize

8. Re: Enhancement request for wxEuphoria

Here's a quick example of how I've implemented a Property Grid-like wxGrid control. I hope this helps. smile

 
include "wxeu/wxeud.e" 
without warning 
 
object void 
 
constant  
    Properties = {"Name", "Class", "Parent", "ID", "Caption", "Location", "Size", "Style"} 
 
constant  
    frmMain     = create( wxFrame, {0, -1, "Property Grid Demo", -1, -1, 480, 320} ), 
    pnlMain     = create( wxPanel, {frmMain} ), 
    grdProp     = create( wxGrid, {pnlMain, -1, 10, 10, 200, 220, 0, 8, 1} ) 
 
set_col_label_size( grdProp, 0 ) 
set_row_label_align( grdProp, wxLEFT, 0 ) 
set_col_size( grdProp, 0, 100 ) 
set_grid_margins( grdProp, 0, 0 ) 
 
for i = 1 to length( Properties ) do 
    set_row_label( grdProp, i-1, Properties[i] ) 
    set_row_size( grdProp, i-1, 23 ) 
end for 
 
wxMain( frmMain ) 

-Greg

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu