Hello all,

I want to delete object (a2dImage) when I press "Delete" on my keyboard. So
far, this is my implementation

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

A2D_BEGIN_EVENT_TABLE(MyImage, a2dImage)
    A2D_EVT_CHAR(MyImage::OnDelete)
A2D_END_EVENT_TABLE()

IMPLEMENT_DYNAMIC_CLASS(MyImage,a2dImage)

MyImage::MyImage()
{
}

MyImage::MyImage(int testId, int x, int y, int layer)
{
    testId_ = testId;
    SetPosXY(x, y);
    SetVisible(false);
    SetStroke(a2dSTROKE_TRANSPARENT);
    SetLayer(layer);

}

MyImage::MyImage(wxImage& image, double xc, double yc, double w, double h,
int faceId):
    a2dImage(image, xc, yc, w, h)
{
    testId_ = testId;
}

void MyImage::SetImg(wxImage& image)
{
    SetImage(image);

    SetWidth(image.GetWidth());
    SetHeight(image.GetHeight());
    SetVisible(true);
}

void MyImage::OnDelete(wxKeyEvent& event )
{
    // 127 is ascii for delete button
    if(event.GetKeyCode() == 127)
        wxLogMessage("tes delete button");
    else
        wxLogMessage("failed");
}

////////////////////////////////////////////////////////////// end of code
/////////////////////////////////////////////////////

But, I couldn't make it work because when I press "delete", one thing that
always happen is my cursor will move to the middle of the object.

Another question is, I want to set null stroke but I always get black for
the stroke colour.


Thanks for help...:D
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Wxart2d-users_dev mailing list
Wxart2d-users_dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev

Reply via email to