Search found 347 matches

by Dark Alchemist
Sun Aug 29, 2010 5:10 pm
Forum: C++ Development
Topic: My grid renderer is crashing my program.
Replies: 22
Views: 3225

Well, the docs say (through "The grid will take ownership of the pointer.") that wxGrid will delete the cell renderer. So I don't believe there will be a leak if the docs are right. Well, must be another leak I have then. :( I still hate seeing dangling new because I had it beaten into me so much t...
by Dark Alchemist
Sun Aug 29, 2010 4:24 am
Forum: C++ Development
Topic: Question about wxgrid with a custom renderer pos memory leak
Replies: 3
Views: 779

Hello, you create how many renderers as you have cells. I don't know wxGrid but it seems weird since I understood that a renderer represents a way the cell is displayed. How about creating only one renderer and attach this to all cells ? MyGridCellRenderer* myRenderer = new MyGridCellRenderer ; for...
by Dark Alchemist
Sun Aug 29, 2010 4:21 am
Forum: C++ Development
Topic: My grid renderer is crashing my program.
Replies: 22
Views: 3225

The docs say The grid will take ownership of the pointer. So you probably need to do for (i = 0; i < maxamount; ++i) { WxGrid1->SetCellRenderer(i, 2, new MyGridCellRenderer()); } http://forums.wxwidgets.org/viewtopic.php?t=28669 See, that is how I have been doing it which means every time we use it...
by Dark Alchemist
Sat Aug 28, 2010 1:45 am
Forum: C++ Development
Topic: My grid renderer is crashing my program.
Replies: 22
Views: 3225

My grid renderer is crashing my program.

If I use new (see my previous thread http://forums.wxwidgets.org/viewtopic.php?t=28669) with my renderer on each pass this works but then I have a memory leak. Now when I do the following code I can use it one time and no more or I will crash. .h #define wxGetBitmapFromMemory(name) _wxGetBitmapFromM...
by Dark Alchemist
Fri Aug 27, 2010 3:56 pm
Forum: C++ Development
Topic: Question about wxgrid with a custom renderer pos memory leak
Replies: 3
Views: 779

No, you are right since I am only using two renderers it would be much easier to simply reuse it then when I call On_Close I can delete them.

Thank you for your help. :)
by Dark Alchemist
Tue Aug 24, 2010 2:44 am
Forum: C++ Development
Topic: How can I get this in a shaped frame?
Replies: 6
Views: 1411

It seems that the whole window is custom-painted, i.e. it uses no native controls. In that case it's pretty easy to achieve per-pixel transparency. http://www.codeproject.com/KB/GDI/pxalphablend.aspx http://www.codeproject.com/KB/dialog/FrameShadow.aspx But creating a wxWidgets frame with standard ...
by Dark Alchemist
Mon Aug 23, 2010 8:18 am
Forum: C++ Development
Topic: How can I get this in a shaped frame?
Replies: 6
Views: 1411

The easiest way to do that is a a bitmap in a window, and hide the frame. Then watch the mouse messages and locations in other words if your on the bitmap or not. This isn't a native code, you can do this on any of the platforms. It is how you manage the window structures and your graphics. That ju...
by Dark Alchemist
Thu Aug 19, 2010 1:24 pm
Forum: C++ Development
Topic: How can I get this in a shaped frame?
Replies: 6
Views: 1411

Auria wrote:Probably by using some native code

wxWidgets aims at portability, as such it does not (cannot) provide all features that the native toolkits do
Well, I don't even know of native code that can do it as this is the first time I have seen anything that looked that nice.
by Dark Alchemist
Thu Aug 19, 2010 4:03 am
Forum: C++ Development
Topic: How can I get this in a shaped frame?
Replies: 6
Views: 1411

How can I get this in a shaped frame?

http://a.imageshack.us/img829/1455/exampleantialiasedcusto.jpg (181k) Look at the pic and its sides it has anti-aliasing on it but on my Wxwidgets in Windows7 I have tried everything I can think of to get anti-aliasing on the edges and nothing has worked. Heck, I have even tried the shadow effect o...
by Dark Alchemist
Wed Aug 18, 2010 8:56 pm
Forum: C++ Development
Topic: Question about wxgrid with a custom renderer pos memory leak
Replies: 3
Views: 779

Question about wxgrid with a custom renderer pos memory leak

WxGrid1->SetCellRenderer(i, 3, new MyGridCellRenderer); Notice that could be any amount of lines long so how would I use a delete on all of the objects I created before I shut down the program? Maybe there is a better way of doing this without having to rely on dynamically creating who knows how man...
by Dark Alchemist
Mon Aug 09, 2010 7:25 pm
Forum: C++ Development
Topic: WxString conversion question.
Replies: 13
Views: 1996

Alrighty doublemax. :)

Thanks everyone for the help as I appreciate it.
by Dark Alchemist
Mon Aug 09, 2010 7:09 pm
Forum: C++ Development
Topic: WxString conversion question.
Replies: 13
Views: 1996

The problem with the printf or wxString::Format solutions is that you have no control over character encoding. These two lines do exactly the same thing. chars is a "char *". char* chars = "Hello world"; char chars[] = "Hello world"; So conversion like given in the wiki page is the way to go. Yes, ...
by Dark Alchemist
Mon Aug 09, 2010 7:07 pm
Forum: C++ Development
Topic: WxString conversion question.
Replies: 13
Views: 1996

I thought the format and the printf were one in the same? I know my time sensitive routine took a serious hit with the printf and that format would mean I would be recreating string with each pass and that would be extremely slow (I tried just wxstring A; a.printf and the wxstring A was killing me).
by Dark Alchemist
Mon Aug 09, 2010 6:58 pm
Forum: C++ Development
Topic: WxString conversion question.
Replies: 13
Views: 1996

I use the wxstring.printf all the time but is it safe to use it for a char array (said block but meant array)?

It works but is it as safe as I can get it? Probably safer than just wxstring = char[X];
by Dark Alchemist
Mon Aug 09, 2010 6:48 pm
Forum: C++ Development
Topic: WxString conversion question.
Replies: 13
Views: 1996

Re: WxString conversion question.

How do I do the opposite of this? What do you want to do? I find Printf very handy wxString str; wxString str2 = wxT("Is this what you want?"); str.Printf(wxT("Test String: %s"), str2.c_str()); Trying to correctly convert a char block (like char X[1024]) into a wxstring. The page I posted a link to...