Search found 10 matches

by imekon
Mon Dec 17, 2007 9:16 pm
Forum: C++ Development
Topic: Pasting from the clipboard
Replies: 3
Views: 659

You can find the full DialogBlocks project here: http://www.imekon.pwp.blueyonder.co.uk/wx/wxclip.zip.
by imekon
Mon Dec 17, 2007 9:13 pm
Forum: C++ Development
Topic: Pasting from the clipboard
Replies: 3
Views: 659

Here's a fragment from a small application to demonstrate the problem: m_dataFormat.SetId(_T("TestAppData")); The clipboard copy code... void MainFrame::OnCopyClick( wxCommandEvent& event ) { wxMemoryOutputStream stream; char *buffer = new char[256]; memset(buffer, 0, 256); stream.Write(buffer, 256)...
by imekon
Sun Dec 16, 2007 10:05 pm
Forum: C++ Development
Topic: Pasting from the clipboard
Replies: 3
Views: 659

Pasting from the clipboard

This works on the Mac but crashes on Windows: if (wxTheClipboard->Open()) { if (wxTheClipboard->IsSupported(m_dataFormat)) { wxCustomDataObject data(m_dataFormat); if (wxTheClipboard->GetData(data)) { ... } } } It crashes inside GetData: Program received signal SIGSEGV, Segmentation fault. 0x0059724...
by imekon
Mon Nov 26, 2007 7:51 am
Forum: Compiler / Linking / IDE Related
Topic: Build Report: Visual C++ 2008 Express & wxWidgets 2.8.6
Replies: 8
Views: 11894

I rebuilt an application I've created with wxWidgets and DialogBlocks with Visual Studio Express 2008. I rebuilt the wxWidgets library by loading the project into Visual Studio and building just the debug/release static versions (not Unicode). Then I built my application (I set up the include paths ...
by imekon
Wed Jan 24, 2007 7:34 am
Forum: C++ Development
Topic: passing configuration to dialog
Replies: 9
Views: 1197

//Stone constructor takes values for team, value and position Stone* tS=new Stone(game->GetTeamOn(), i, -99); tmpStone[i]=tS; //cleanup delete tS; tS=NULL; You create a Stone object, store its pointer in an array, then delete it. All you've done is store a non-existant pointer, a recipe for a crash...
by imekon
Fri Jan 19, 2007 4:10 pm
Forum: Component Writing
Topic: Custom events passing values back to controls
Replies: 8
Views: 1924

clyde729 wrote: You have to call the baseclass - version of the copy-ctor in order to copy things like eventobject or eventtype (propagation-level, too).
You're right... I had a feeling I was missing something when I wrote it.
by imekon
Fri Jan 19, 2007 9:38 am
Forum: Component Writing
Topic: Custom events passing values back to controls
Replies: 8
Views: 1924

vdell wrote:
FYI, this would be same as deriving from wxEvent and doing

Code: Select all

wxEvent::m_propagationLevel = wxEVENT_PROPAGATE_MAX;
in your derived constructor.
This didn't work - perhaps more settings need to change.
by imekon
Thu Jan 18, 2007 8:52 pm
Forum: Component Writing
Topic: Custom events passing values back to controls
Replies: 8
Views: 1924

You have to derive (at least) from wxCommandEvent (or wxNotifyEvent), if you want to catch the event in the frame. Only wxCommandEvent and its derivates are allowed to climb up the window hierarchy. Since your event only derives from wxEvent, it won't get catched. If you wan't to use it in that way...
by imekon
Thu Jan 18, 2007 8:49 pm
Forum: Component Writing
Topic: Custom events passing values back to controls
Replies: 8
Views: 1924

Hi, You didn't show your copy constructor implementation, but it needs to contain the line: this->SetCount( original.GetCount() ); Regards, David This is the copy constructor: wxNoteCountEvent::wxNoteCountEvent( const wxNoteCountEvent &original ) { count = original.count; } Still didn't help though.
by imekon
Thu Jan 18, 2007 5:12 pm
Forum: Component Writing
Topic: Custom events passing values back to controls
Replies: 8
Views: 1924

Custom events passing values back to controls

As far as I can see, events can inform other objects about details etc. How would I write an event that a control issues that expects a value to be returned? I tried the following: class wxNoteCountEvent : public wxEvent { public: wxNoteCountEvent( const wxNoteCountEvent &original ); wxNoteCountEven...