Search found 122 matches

by Deluge
Fri Dec 16, 2011 7:03 pm
Forum: C++ Development
Topic: Loading Icon from Char Array
Replies: 4
Views: 1486

Re: Loading Icon from Char Array

It's not working: const int tux_png_size = sizeof(tux_png); wxMemoryInputStream _mem_i_s(tux_png, tux_png_size); wxIcon icon = wxICON(wxImage(_mem_i_s, wxBITMAP_TYPE_ANY)); SetIcon(icon); test.cpp:24:1: error: pasting ")" and "_xpm" does not give a valid preprocessing token test.cpp: In constructor ...
by Deluge
Thu Dec 15, 2011 3:06 am
Forum: C++ Development
Topic: Loading Icon from Char Array
Replies: 4
Views: 1486

Loading Icon from Char Array

I'm on Linux and I'm trying to use a const unsigned char[] that is data from a .png image for an icon: static const unsigned char tux_png[] = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x01, 0xdf, 0x08, 0x06, ...
by Deluge
Mon Aug 29, 2011 4:23 am
Forum: C++ Development
Topic: Get Left or Right Shift/Alt/Ctrl Key Presses
Replies: 2
Views: 890

Re: Get Left or Right Shift/Alt/Ctrl Key Presses

Thanks, I think I can work with those. I saw those in the wx docs but I didn't look much closer when I saw that they were platform dependent. Now that I think about it, It should work just fine.
by Deluge
Mon Aug 29, 2011 1:11 am
Forum: C++ Development
Topic: Get Left or Right Shift/Alt/Ctrl Key Presses
Replies: 2
Views: 890

Get Left or Right Shift/Alt/Ctrl Key Presses

Can wx differentiate between left and right Shift/Alt/Ctrl key presses? I thought there was a way, but maybe I'm wrong. Both left and right key presses produce the same key code. For example left and right Shift both produce 306. int OnKeyDown(wxKeyEvent &event) { cout << event.GetKeyCode() << endl;...
by Deluge
Thu Mar 03, 2011 5:13 am
Forum: C++ Development
Topic: Decoding Ogg to wxSound
Replies: 3
Views: 946

From what I understand there is no way to do this. An external sound library, like libao, has to be used.
by Deluge
Thu Mar 03, 2011 5:11 am
Forum: C++ Development
Topic: wxToolBar->SetToolSeparation Doesn't Work
Replies: 3
Views: 747

I'm guessing that the Gtk toolbar does not have this function and since wxToolBar wraps around the Gtk toolbar SetToolSeparation won't work.
by Deluge
Wed Dec 29, 2010 1:19 am
Forum: C++ Development
Topic: Decoding Ogg to wxSound
Replies: 3
Views: 946

I've gotten pretty close. I'm able to check if a file is a valid ogg. decoder.h: #include <wx/wx.h> #include <wx/sound.h> #include <vorbis/vorbisfile.h> class MainWindow : public wxFrame { public: MainWindow(const wxString& title); private: wxSound *audio; OggVorbis_File vf; FILE *infile; }; decoder...
by Deluge
Tue Dec 28, 2010 8:23 pm
Forum: C++ Development
Topic: Decoding Ogg to wxSound
Replies: 3
Views: 946

Decoding Ogg to wxSound

This is more of a question about Ogg than wxWidgets. Does anyone have experience with libogg or libvorbis? I am trying to decode an Ogg audio file to play through wxSound. I've looked for tutorials and I've looked through samples and documentation at xiph.org . I've also looked at the source in oggd...
by Deluge
Sat Oct 23, 2010 4:33 am
Forum: Compiler / Linking / IDE Related
Topic: Compiler Not Looking in Explicit LIB Directory
Replies: 2
Views: 1672

Compiler Not Looking in Explicit LIB Directory

I have recently compiled wxWidgets 2.9.1 for windows with MinGW/MSYS. My wxWidgets directory is located in C:\Env\wxWidgets-2.9.1 . I point the compiler to the lib and include directories, but it doesn't find lib . Here is the command and output: $ g++ test.cpp `wx-config --cxxflags --libs` -IC:/Env...
by Deluge
Mon Aug 30, 2010 5:37 am
Forum: C++ Development
Topic: AboutDialogInfo/AboutBox Isn't Modal
Replies: 1
Views: 375

I forgot to mention that I am using Linux with GTK+. I've found that the issue is with wxGTK, as the wxAboutDialogInfo works normally on Windows platforms. I am using wxGTK 2.8.10.1 and have found a bug report about the issue, but I'm not sure if it has been fixed in newer versions and am unable to ...
by Deluge
Fri Aug 27, 2010 11:50 pm
Forum: C++ Development
Topic: wxRadioButton::SetForegroundColour()
Replies: 1
Views: 312

wxWidgets uses the native radio button control, so the Win7/Vista radio button class probably does not allow changing color. If there is not a generic radio button class available, I think your only other option is to create your own class.
by Deluge
Fri Aug 27, 2010 11:18 pm
Forum: C++ Development
Topic: wxMenu and wxMenuBar colour
Replies: 3
Views: 958

What platform are you using? Sometimes it is platform-dependent. For example, with a wxToolBar, if you are using Windows you can change the color of the tool bar. But on Linux, using wxGTK, you cannot.
by Deluge
Mon Aug 23, 2010 7:49 am
Forum: C++ Development
Topic: AboutDialogInfo/AboutBox Isn't Modal
Replies: 1
Views: 375

AboutDialogInfo/AboutBox Isn't Modal

Is there a way to make an AboutDialogInfo/AboutBox window modal? I haven't been able to find it anywhere in the wxPyDocs or wx docs . Currently, when the AboutBox is open, I can still interact with the main window and open as many about boxes as I want, which doesn't seem like it should be the defau...
by Deluge
Sat Jul 17, 2010 7:11 pm
Forum: C++ Development
Topic: wxFileDialog: Auto Extension on Save
Replies: 2
Views: 802

Well, the problem is that I need the dialog to prompt for file overwrite. Adding the extension myself after the dialog has closed will automatically overwrite. I would then have to create my own message dialog to display a prompt. The annoying thing about that is that the file dialog will have alrea...
by Deluge
Sat Jul 17, 2010 1:16 pm
Forum: C++ Development
Topic: wxFileDialog: Auto Extension on Save
Replies: 2
Views: 802

wxFileDialog: Auto Extension on Save

Is there a way to have a wxFileDialog automatically add a file extension when the "save" button is pressed? For example if I am saving as a text file, and I call my file "instructions" I want the dialog to add ".txt" to the end of it. And if I name my file "instructions.txt", I want it to leave it a...