Search found 204 matches

by papayrus
Tue Aug 28, 2012 4:55 pm
Forum: C++ Development
Topic: Get First Key wxRegKey Error
Replies: 19
Views: 4752

Re: Get First Key wxRegKey Error

Don't trust sample code - compilers usually don't lie ;) OK. But there is something weird here this pops up the messagebox for the registry value but it does not pop up the message box for the subkey name. I tried to use the size t var but it won't work because I think it needs to be a long? I noti...
by papayrus
Tue Aug 28, 2012 4:41 pm
Forum: C++ Development
Topic: Get First Key wxRegKey Error
Replies: 19
Views: 4752

Re: Get First Key wxRegKey Error

// Read the value back. long value; key.QueryValue(wxT("MyValue"), &value); wxMessageBox(wxString::Format(wxT("%d"), value), wxT("Registry Value"), wxOK); // Get the number of subkeys and enumerate them. size_t subkeys; key.GetKeyInfo(&subkeys, NULL, NULL, NULL); wxString key_name; key.GetFirstKey(...
by papayrus
Tue Aug 28, 2012 4:29 pm
Forum: C++ Development
Topic: Get First Key wxRegKey Error
Replies: 19
Views: 4752

Re: Get First Key wxRegKey Error

Are you sure it's the same code line and not this one? key.GetNextKey(wxT("key_name"), 1); Please post the exact error message and the exact line that matches the error. I think this is all of the debug output I get on it. Yes I am now using this Code the errors are below the code. void RegistryFra...
by papayrus
Tue Aug 28, 2012 4:23 pm
Forum: C++ Development
Topic: Get First Key wxRegKey Error
Replies: 19
Views: 4752

Re: Get First Key wxRegKey Error

Change: key.GetFirstKey(wxT("key_name"), 1); To: key.GetFirstKey(key_name, 1); (and the other line with the same error) It needs to be a (non-const) reference to a real wxString, because the method writes a result back into it. I already tried that and get the same error. key.GetFirstKey(key_name, ...
by papayrus
Tue Aug 28, 2012 4:18 pm
Forum: C++ Development
Topic: Gradients
Replies: 3
Views: 1494

Re: Gradients

You have to catch the erase background event and draw the gradient yourself. If you can use a static bitmap as a background, wxCustomBackgroundWindow can help (2.9.x only): http://docs.wxwidgets.org/trunk/classwx_custom_background_window.html The screenshot you posted will require some effort, espe...
by papayrus
Tue Aug 28, 2012 3:29 pm
Forum: C++ Development
Topic: Get First Key wxRegKey Error
Replies: 19
Views: 4752

Get First Key wxRegKey Error

I get an error here telling me that there is no matching function to wxRegKey GetFirstKey // This assume that the key already exists, use HasSubKey() to check // for the key existence if necessary. wxRegKey key(wxRegKey::HKLM, (wxT("Software\\MyKey"))); // Create a new value "MyValue" and set it to ...
by papayrus
Tue Aug 28, 2012 3:22 pm
Forum: C++ Development
Topic: Gradients
Replies: 3
Views: 1494

Gradients

Hello I can't seem to find a basic way to add a gradient fill for my frame background rather than a solid color. Can you please help me on this would really like to make my GUI look nicer. Also can anyone tell me how they got there GUI to look like this? This is supposed to be an app that was made i...
by papayrus
Fri Aug 24, 2012 3:58 am
Forum: C++ Development
Topic: Need help animating a .ani cursor
Replies: 4
Views: 4746

Re: Need help animating a .ani cursor

Yes I already loaded a native windows cursor and it loads and animates but it will not animate any of my custom cursors. Oh well if it does not support it then I guess there is not anything I can do. Thanks alot for the info. I just think it is kind of weird though that it supports .ani files but ju...
by papayrus
Thu Aug 23, 2012 8:20 pm
Forum: C++ Development
Topic: Need help animating a .ani cursor
Replies: 4
Views: 4746

Re: Need help animating a .ani cursor

I tried that but will that load .ani files and also will it auto play or do I need to ->Play it because I tried this and it did not work either but I will try again and see if I did something wrong. EDIT it works just loading it like this but how can I set it to the cursor? m_animationCtrl = new wxA...
by papayrus
Thu Aug 23, 2012 1:04 pm
Forum: C++ Development
Topic: Need help animating a .ani cursor
Replies: 4
Views: 4746

Need help animating a .ani cursor

When I load a .ani for a cursor it loads but does not animate at all. This is the code I made for it.

Code: Select all

wxImage image4(wxT("Ani\\Arrow.ani"), wxBITMAP_TYPE_ANI);
if (image4.Ok())
wxCursor cursor4(image4);
TextCtrl4->SetCursor(wxCursor(image4));
by papayrus
Tue Jul 31, 2012 2:37 pm
Forum: C++ Development
Topic: wxMediaCtrl Load - from memory instead of file
Replies: 7
Views: 1777

Re: wxMediaCtrl Load - from memory instead of file

How about this? Unless I am way off here. It is not wxWidgets but it plays an MP3. mciSendString(TEXT("open sounds\\dualtrax&nagz-neverland.mp3"),NULL,0,NULL); mciSendString(TEXT("play sounds\\dualtrax&nagz-neverland.mp3"), NULL, 0, 0); then to close it mciSendString(TEXT("stop sounds\\dualtrax&nagz...
by papayrus
Sat Jul 28, 2012 6:43 am
Forum: C++ Development
Topic: How to Clear TextCtrl on Click?
Replies: 32
Views: 12187

Re: How to Clear TextCtrl on Click?

Yeah I just opened the sln after exrtacting wxWidgets 2.9 from the zip and built it in vs2008 and it built no problems. I made the connect thing in code blocks with wxWidget 2.8 so I will be orientating myself the next few days in vs 2008 then I will try it using bind instead of connect. Thanks for ...
by papayrus
Sat Jul 28, 2012 12:44 am
Forum: C++ Development
Topic: How to Clear TextCtrl on Click?
Replies: 32
Views: 12187

Re: How to Clear TextCtrl on Click?

I think VC2008 Express is probably the easiest solution for people starting with wxWidgets, because it builds the current wx 2.9.4 out of the box. Just doubleclick <wxdir>/build/msw/wx_vc9.sln -> let it load -> Build solution. Ok I have VSE 2008 C++ installed I opened wxWidgets solution and built i...
by papayrus
Fri Jul 27, 2012 11:30 pm
Forum: C++ Development
Topic: How to Clear TextCtrl on Click?
Replies: 32
Views: 12187

Re: How to Clear TextCtrl on Click?

Only command events propagate upwards in the object hierarchy, the focus event not a command event. So you have to connect to the control itself. m_your_text_ctrl->Connect(wxEVT_SET_FOCUS, wxFocusEventHandler(ClearFrame::OnTextCtrlFocus), NULL, this); void ClearFrame::OnTextCtrlFocus(wxFocusEvent &...
by papayrus
Fri Jul 27, 2012 11:12 pm
Forum: C++ Development
Topic: How to Clear TextCtrl on Click?
Replies: 32
Views: 12187

Re: How to Clear TextCtrl on Click?

OK I set the event to

Code: Select all

Connect(ID_TEXTCTRL1,wxEVT_SET_FOCUS,(wxObjectEventFunction)&ClearFrame::OnTextCtrl1Clicked);
it's not clearing the box it compiles fine though.