Search found 172 matches

by leiradella
Tue Aug 18, 2009 1:56 pm
Forum: C++ Development
Topic: Keeping an eye on the clipboard
Replies: 5
Views: 1285

Romas wrote:Hello,

If we are talking about windows only project, then there is a function you might read about: SetClipboardViewer. However, if the project is multiplatform, I cannot help you :)
Thanks, but although the app is not multiplatform I don't want to tie it to any OS.

Cheers,

Andre
by leiradella
Tue Aug 18, 2009 4:55 am
Forum: C++ Development
Topic: Copying a metafile to the clipboard
Replies: 6
Views: 2604

Also, wxMetafile::SetClipboard() doesn't call wxTheClipboard->Open() to acquire the clipboard. Is it a bug or wxTheClipboard::AddData() does it behind the scenes?

Cheers,

Andre
by leiradella
Tue Aug 18, 2009 4:50 am
Forum: C++ Development
Topic: Keeping an eye on the clipboard
Replies: 5
Views: 1285

I haven't used yet but as far as I know, wxWidgets sends wxUpdateUIEvent events when it becomes idle so that you can check if anything needs to be updated when the application is idle (like if a menu item should become unavailable): http://docs.wxwidgets.org/stable/wx_wxupdateuievent.html#wxupdateu...
by leiradella
Tue Aug 18, 2009 4:45 am
Forum: C++ Development
Topic: Copying a metafile to the clipboard
Replies: 6
Views: 2604

I debugged my app step-by-step and wxMetafile::SetClipboard() is defined as: bool wxEnhMetaFile::SetClipboard(int WXUNUSED(width), int WXUNUSED(height)) { #if wxUSE_DRAG_AND_DROP && wxUSE_CLIPBOARD wxCHECK_MSG( m_hMF, false, _T("can't copy invalid metafile to clipboard") ); return ...
by leiradella
Tue Aug 18, 2009 3:33 am
Forum: C++ Development
Topic: SQLite DB multiple thread manipulation in GUI
Replies: 14
Views: 2893

Your original LongQueryThreadProc was: void LongQueryThreadProc(void* p) { SQLite3DB* pdb=(SQLite3DB*)p; // some long and time consuming query goes here... nThreads--; } and you were not updating the UI there. Now you're invoking wxMessageBox so you better follow doublemax's advices. Your program is...
by leiradella
Tue Aug 18, 2009 2:56 am
Forum: C++ Development
Topic: SQLite DB multiple thread manipulation in GUI
Replies: 14
Views: 2893

Any reason to use _beginthread? Maybe CreateThread or wxWindows thread facilities will do better?

Cheers,

Andre
by leiradella
Tue Aug 18, 2009 1:48 am
Forum: C++ Development
Topic: SQLite DB multiple thread manipulation in GUI
Replies: 14
Views: 2893

Can you verify if

Code: Select all

// some long and time consuming query goes here...
Finishes or is hanging?

Cheers,

Andre
by leiradella
Mon Aug 17, 2009 4:58 pm
Forum: C++ Development
Topic: SQLite DB multiple thread manipulation in GUI
Replies: 14
Views: 2893

samsam598 wrote:But I still do not know where to put *volatile*.
Sorry, my bad. You should use volatile in the declaration of nThreads, in the part of your code where you say global variables.

Cheers,

Andre
by leiradella
Mon Aug 17, 2009 4:34 am
Forum: C++ Development
Topic: Copying a metafile to the clipboard
Replies: 6
Views: 2604

Sorry. Call wxClipboard::SetData() once, but call wxDataObject::SetData() of the data object you pass in the one call to wxClipboard::SetData() multiple times for each format http://docs.wxwidgets.org/stable/wx_wxdataobject.html#wxdataobjectsetdata -Max FYI: I haven't tried it but wxDataObject::Set...
by leiradella
Mon Aug 17, 2009 3:52 am
Forum: C++ Development
Topic: Copying a metafile to the clipboard
Replies: 6
Views: 2604

Use the SetData() method of wxClipboard to set the data for each of the different formats you are interested in. http://docs.wxwidgets.org/stable/wx_wxclipboard.html#wxclipboard -Max Hum, the pages says: Call this function to set the data object to the clipboard. This function will clear all previo...
by leiradella
Mon Aug 17, 2009 2:14 am
Forum: C++ Development
Topic: Copying a metafile to the clipboard
Replies: 6
Views: 2604

Copying a metafile to the clipboard

Hi All, I'd like to copy a metafile to the clipboard along with some other formats in a wxDataObjectComposite object. I already copy metafiles using void Panel::CopyAsMetafile() { #ifdef _WIN32 wxMetafileDC mdc; m_Graph->Paint(mdc); wxMetafile *meta = mdc.Close(); meta->SetClipboard(); delete meta; ...
by leiradella
Mon Aug 17, 2009 2:11 am
Forum: C++ Development
Topic: Keeping an eye on the clipboard
Replies: 5
Views: 1285

Keeping an eye on the clipboard

Hi All, My app uses a timer in order to check if the clipboard contains compatible data that it can paste: void Shader::OnTimer(wxTimerEvent& evt) { m_MenuBar->Enable(wxID_PASTE, wxTheClipboard->IsSupported(wxDataFormat(wxT("igFragmentShader/Selection")))); } It works fine, but it feel...
by leiradella
Mon Aug 17, 2009 2:06 am
Forum: C++ Development
Topic: Custom clipboard content
Replies: 0
Views: 562

Custom clipboard content

Hi All, I'm trying to copy custom data to/from the clipboard but am failing. Copy code: // Generate XML. wxXmlDocument doc; doc.SetRoot(SerializeSelected()); wxStringOutputStream sos; doc.Save(sos); wxString xml = sos.GetString(); // Create a custom data object we recognize. wxCustomDataObject *cdo ...
by leiradella
Mon Aug 17, 2009 1:01 am
Forum: C++ Development
Topic: SQLite DB multiple thread manipulation in GUI
Replies: 14
Views: 2893

Thank you Andre! But I am sorry it does not make sense :P Yes it does because your problem as stated in your first post is: The program hangs at "Waiting for LongQueryThreadProc". It's stuck because it doesn't see nThreads changing its value as the compiler "caches" the value. P...
by leiradella
Sat Aug 15, 2009 9:26 pm
Forum: C++ Development
Topic: Using wxInputStream for wxImage Creation
Replies: 11
Views: 2512

I'd like to remember you I've never used wxWidgets' socket classes, so I may be missing some easier way of doing this. In the app that will send the image: 1. create a new thread which creates a socket connected to the other app that will receive the image. 2. image.SaveFile() the image over the out...