|
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next 1 |
1. wxSplashscreen class question #3124 Posted by: 2003-12-27 04:46:47 |
Hi,
I've just installed wxWindows for Dev-C++, and i must say it's a great program. Good work! Anyway, i've got a question about a splashscreen i'm trying to use. I'm looking at this reference:
http://www.wxwindows.org/manuals/2.4.2/wx355.htm#wxsplashscreenwxsplashscreen
And now i need to paste this somewhere:
wxBitmap bitmap; if (bitmap.LoadFile("splash16.png", wxBITMAP_TYPE_PNG)) { wxSplashScreen* splash = new wxSplashScreen(bitmap, wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT, 6000, NULL, -1, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxSTAY_ON_TOP); } wxYield();
Where do i put it? Thanks in advance, ow andum, Merry Christmas!!
Tim 2K |
2. Re: wxSplashscreen class question #3126 Posted by: 2003-12-27 19:05:29 |
Hmm, i just realised that i downloaded the Dev-C++ package only.. is that enough to get the entire wxWindows stuff? I'm now downloading the full 13 mb package. Samples should be included there.
Tim 2K |
3. Re: wxSplashscreen class question #3128 Posted by: upCASE 2003-12-27 19:27:28 |
Hi! What you get and what works depends on which devpak you downloaded. The samples are included in the full pack from the wxWindows site, but this is a source release so you will have to compile it yourself (which I'd advise you to do). The devpak I released so time ago should contain the code for the samples too. If you need the contribs, they are in a different devpak. You should be able to compile every wxWindows stuff with the devpaks though. The only diference is that the devpak contains the precompiled lib, not the the complete sources.
About you problem: Well, copy&paste it where it makes sense :) If you want a splashscreen on startup, do it in the contructor of you main window for example. Be sure to link libpng.a in for PNG support.
upcaseupCASE ----------------------------------- If it was hard to write, it should be hard to read!- Do. Or do not. There is no try! |
4. Re: wxSplashscreen class question #3134 Posted by: 2003-12-28 01:07:05 |
Is there a splashscreen sample somewhere? I want it to first show the splashscreen and then continue with a wizard. Sounds complicated to me :S Thanks in advance, Tim 2K |
5. Re: wxSplashscreen class question #3136 Posted by: upCASE 2003-12-29 22:06:21 |
Hi! Nope, it's not complicated :) Call the splashscreen either from your main app entry point or from the constructor of the wizard. That way the splashscreen will be shown, it times out and the initialisation continues. I guess you don't need to call wxYield(). Since the splashscreen is timed it will destroy itself once the time is over.
upcaseupCASE ----------------------------------- If it was hard to write, it should be hard to read!- Do. Or do not. There is no try! |
6. Re: wxSplashscreen class question #3138 Posted by: 2003-12-29 22:26:09 |
Would you mind attaching a working version of a wizard that NOT launches a window, just the wizard. Sorry i can't get it to work.
// ---------------------------------------------------------------------------- // the application class // ----------------------------------------------------------------------------
// 'Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { wxBitmap bitmap; if(bitmap.LoadFile("launch.png", wxBITMAP_TYPE_PNG)) { wxSplashScreen *splash = new wxSplashScreen(bitmap, wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT, 6000, NULL, -1, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxSTAY_ON_TOP); }
Compile log:
Compiler: Default compiler Building Makefile: "D:DevCCMakefile.win" Executing make... make.exe -f "D:DevCCMakefile.win" all g++.exe -c main.cpp -o main.o -I"D:/DevCpp/include/c++" -I"D:/DevCpp/include/c++/mingw32" -I"D:/DevCpp/include/c++/backward" -I"D:/DevCpp/include" -DWINVER=0x0400 -D__WIN95__ -D__GNUWIN32__ -D__WIN32__ -DHAVE_W32API_H -D__WXMSW__ -D__WINDOWS__ -Wall -fno-pcc-struct-return -O2 -Os -fno-rtti -fno-exceptions
main.cpp: In member function `virtual bool MyApp::OnInit()': main.cpp:118: warning: unused variable `wxSplashScreen*splash'
g++.exe main.o DreamXP_private.res -o "DreamXP.exe" -L"D:/DevCpp/lib" -mwindows -Wl,--subsystem,windows -mwindows -lwxmsw -lstdc++ -lgcc -lodbc32 -lwsock32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lopengl32 -lglu32 -lole32 -loleaut32 -luuid
Execution terminated
Thanks again, Tim 2K |
7. Re: wxSplashscreen class question #3140 Posted by: upCASE 2003-12-30 04:07:30 |
Hi! Sorry, but now I'm at a loss... What exactly do you want to do?
"Would you mind attaching a working version of a wizard that NOT launches a window, just the wizard." Judging from the code sample you send the only thing your app could do is to show a splashscreen and then... nothing! If you want a wizard to show up, you should create an instance of one in OnInit() and maybe call SetTopWindow(myWizard). You must call RunWizard() either from OnInit() or in the ctor of the wizard. Be sure to call Destroy() for the wizard.
If you don't want to launch "a window" (the splashscreen I presume), just don't contruct it...
upcaseupCASE ----------------------------------- If it was hard to write, it should be hard to read!- Do. Or do not. There is no try! |
8. Re: wxSplashscreen class question #3142 Posted by: 2003-12-30 04:42:21 |
Omg sorry, i'm asking two things which should be one :S Eh.. basically what i want is a splashscreen with a wizard. But i haven't got a clue to do that. I'll see what i can cum up with. sorry for the confusion. Tim 2K |
9. Re: wxSplashscreen class question #3143 Posted by: upCASE 2003-12-30 18:00:52 |
Hi! When I find the time later this day, I'll hack a little example that creates a wizard and shows a splashscreen before the wizard gets created. That's what you want, right? A simple "hello, about, version" splashscreen and then your killer app :)
upcaseupCASE ----------------------------------- If it was hard to write, it should be hard to read!- Do. Or do not. There is no try! |
10. Re: wxSplashscreen class question #3146 Posted by: 2003-12-30 23:18:11 |
Yup exactly! :D Thanks a lot, hope you've got some time left ;)
Tim 2K |
11. Re: wxSplashscreen class question #3150 Posted by: upCASE 2003-12-31 23:55:35 |
Hi!
Sorry, had no time yesterday... Here's a small example that loads a bitmap file, shows a splashscreen and then runs a wizard.
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include <wx/wizard.h>
#include <wx/image.h>
#include <wx/splash.h>
class MainApp: public wxApp
{
public:
virtual bool OnInit();
};
IMPLEMENT_APP(MainApp)
bool MainApp::OnInit()
{
wxInitAllImageHandlers();
wxBitmap logo;
logo.LoadFile("logo.bmp",wxBITMAP_TYPE_BMP);
wxWizard* wizard = new wxWizard(NULL,-1,"Test");
wxWizardPageSimple* m_page1 = new wxWizardPageSimple;
wxSplashScreen* splash = new wxSplashScreen(logo,
wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT,
6000, wizard, -1, wxDefaultPosition, wxDefaultSize,
wxSIMPLE_BORDER|wxSTAY_ON_TOP);
wizard->RunWizard(m_page1);
wizard->Destroy();
return true;
}
Not much in there. You'll need to add your pages to the wizard. Be sure to call Destroy() for the wizard if you don't want you app to "hang".
upcaseupCASE ----------------------------------- If it was hard to write, it should be hard to read!- Do. Or do not. There is no try! |
12. Re: wxSplashscreen class question #3155 Posted by: 2004-01-01 01:26:38 |
My compile log:
Compiler: Default compiler Building Makefile: "D:DevCCMakefile.win" Executing make... make.exe -f "D:DevCCMakefile.win" all g++.exe main.o -o "DreamXP.exe" -L"D:/DevCpp/lib" -mwindows -Wl,--subsystem,windows -mwindows -lwxmsw -lstdc++ -lgcc -lodbc32 -lwsock32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lopengl32 -lglu32 -lole32 -loleaut32 -luuid
D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0xd5):imagpng.cpp: undefined reference to `png_get_io_ptr' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0xf5):imagpng.cpp: undefined reference to `png_get_io_ptr' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x119):imagpng.cpp: undefined reference to `png_get_io_ptr' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x178):imagpng.cpp: undefined reference to `png_get_io_ptr' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x257):imagpng.cpp: undefined reference to `png_create_read_struct' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x2a0):imagpng.cpp: undefined reference to `png_destroy_read_struct' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x2c2):imagpng.cpp: undefined reference to `png_destroy_read_struct' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x313):imagpng.cpp: undefined reference to `png_set_error_fn' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x321):imagpng.cpp: undefined reference to `png_set_read_fn' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x329):imagpng.cpp: undefined reference to `png_create_info_struct' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x35c):imagpng.cpp: undefined reference to `png_read_info' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x37f):imagpng.cpp: undefined reference to `png_get_IHDR' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x39e):imagpng.cpp: undefined reference to `png_set_strip_16' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x3a6):imagpng.cpp: undefined reference to `png_set_packing' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x3b3):imagpng.cpp: undefined reference to `png_get_valid' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x3cd):imagpng.cpp: undefined reference to `png_set_filler' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x43a):imagpng.cpp: undefined reference to `png_read_image' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x445):imagpng.cpp: undefined reference to `png_read_end' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x454):imagpng.cpp: undefined reference to `png_destroy_read_struct' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x5ee):imagpng.cpp: undefined reference to `png_set_expand' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x5fc):imagpng.cpp: undefined reference to `png_set_expand' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x60a):imagpng.cpp: undefined reference to `png_set_expand' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x652):imagpng.cpp: undefined reference to `png_create_write_struct' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x6a7):imagpng.cpp: undefined reference to `png_set_error_fn' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x6af):imagpng.cpp: undefined reference to `png_create_info_struct' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x6d2):imagpng.cpp: undefined reference to `png_destroy_write_struct' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x6ec):imagpng.cpp: undefined reference to `png_set_write_fn' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x717):imagpng.cpp: undefined reference to `png_set_IHDR' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x736):imagpng.cpp: undefined reference to `png_set_sBIT' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x741):imagpng.cpp: undefined reference to `png_write_info' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x74a):imagpng.cpp: undefined reference to `png_set_shift' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x752):imagpng.cpp: undefined reference to `png_set_packing' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x83b):imagpng.cpp: undefined reference to `png_write_rows' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x857):imagpng.cpp: undefined reference to `png_write_end' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x864):imagpng.cpp: undefined reference to `png_destroy_write_struct' D:/DevCpp/lib/libwxmsw.a(imagpng.o)(.text+0x879):imagpng.cpp: undefined reference to `png_destroy_write_struct' D:/DevCpp/lib/libwxmsw.a(imagjpeg.o)(.text+0x20a):imagjpeg.cpp: undefined reference to `jpeg_resync_to_restart' D:/DevCpp/lib/libwxmsw.a(imagjpeg.o)(.text+0x297):imagjpeg.cpp: undefined reference to `jpeg_std_error' D:/DevCpp/lib/libwxmsw.a(imagjpeg.o)(.text+0x2e9):imagjpeg.cpp: undefined reference to `jpeg_destroy_decompress' D:/DevCpp/lib/libwxmsw.a(imagjpeg.o)(.text+0x349):imagjpeg.cpp: undefined reference to `jpeg_CreateDecompress' D:/DevCpp/lib/libwxmsw.a(imagjpeg.o)(.text+0x35a):imagjpeg.cpp: undefined reference to `jpeg_read_header' D:/DevCpp/lib/libwxmsw.a(imagjpeg.o)(.text+0x36a):imagjpeg.cpp: undefined reference to `jpeg_start_decompress' D:/DevCpp/lib/libwxmsw.a(imagjpeg.o)(.text+0x396):imagjpeg.cpp: undefined reference to `jpeg_finish_decompress' D:/DevCpp/lib/libwxmsw.a(imagjpeg.o)(.text+0x39c):imagjpeg.cpp: undefined reference to `jpeg_destroy_decompress' D:/DevCpp/lib/libwxmsw.a(imagjpeg.o)(.text+0x3f2):imagjpeg.cpp: undefined reference to `jpeg_finish_decompress' D:/DevCpp/lib/libwxmsw.a(imagjpeg.o)(.text+0x3f8):imagjpeg.cpp: undefined reference to `jpeg_destroy_decompress' D:/DevCpp/lib/libwxmsw.a(imagjpeg.o)(.text+0x416):imagjpeg.cpp: undefined reference to `jpeg_read_scanlines' D:/DevCpp/lib/libwxmsw.a(imagjpeg.o)(.text+0x555):imagjpeg.cpp: undefined reference to `jpeg_std_error'
D:/DevCpp/lib/libwxmsw.a(imagjpeg.o)(.text+0x59c):imagjpeg.cpp: undefined reference to `jpeg_destroy_compress'
D:/DevCpp/lib/libwxmsw.a(imagjpeg.o)(.text+0x5e2):imagjpeg.cpp: undefined reference to `jpeg_CreateCompress' D:/DevCpp/lib/libwxmsw.a(imagjpeg.o)(.text+0x627):imagjpeg.cpp: undefined reference to `jpeg_set_defaults' D:/DevCpp/lib/libwxmsw.a(imagjpeg.o)(.text+0x686):imagjpeg.cpp: undefined reference to `jpeg_start_compress' D:/DevCpp/lib/libwxmsw.a(imagjpeg.o)(.text+0x6b4):imagjpeg.cpp: undefined reference to `jpeg_finish_compress' D:/DevCpp/lib/libwxmsw.a(imagjpeg.o)(.text+0x6ba):imagjpeg.cpp: undefined reference to `jpeg_destroy_compress' D:/DevCpp/lib/libwxmsw.a(imagjpeg.o)(.text+0x6e5):imagjpeg.cpp: undefined reference to `jpeg_write_scanlines' D:/DevCpp/lib/libwxmsw.a(imagjpeg.o)(.text+0x732):imagjpeg.cpp: undefined reference to `jpeg_set_quality' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x1dc):imagtiff.cpp: undefined reference to `TIFFClientOpen' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x212):imagtiff.cpp: undefined reference to `TIFFClientOpen' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x2de):imagtiff.cpp: undefined reference to `TIFFSetDirectory' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x2f0):imagtiff.cpp: undefined reference to `TIFFClose' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x332):imagtiff.cpp: undefined reference to `TIFFGetField' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x341):imagtiff.cpp: undefined reference to `TIFFGetField'
D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x351):imagtiff.cpp: undefined reference to `_TIFFmalloc' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x387):imagtiff.cpp: undefined reference to `_TIFFfree' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x3c4):imagtiff.cpp: undefined reference to `TIFFReadRGBAImage' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x3d7):imagtiff.cpp: undefined reference to `_TIFFfree' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x495):imagtiff.cpp: undefined reference to `_TIFFfree' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x49b):imagtiff.cpp: undefined reference to `TIFFClose' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x56d):imagtiff.cpp: undefined reference to `TIFFReadDirectory' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x578):imagtiff.cpp: undefined reference to `TIFFClose' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x5fc):imagtiff.cpp: undefined reference to `TIFFSetField' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x612):imagtiff.cpp: undefined reference to `TIFFSetField'
D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x61f):imagtiff.cpp: undefined reference to `TIFFSetField' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x62f):imagtiff.cpp: undefined reference to `TIFFSetField' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x63c):imagtiff.cpp: undefined reference to `TIFFSetField' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x649):imagtiff.cpp: more undefined references to `TIFFSetField' follow D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x677):imagtiff.cpp: undefined reference to `TIFFScanlineSize' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x691):imagtiff.cpp: undefined reference to `TIFFDefaultStripSize' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x69f):imagtiff.cpp: undefined reference to `TIFFSetField' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x6f3):imagtiff.cpp: undefined reference to `TIFFWriteScanline'
D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x71a):imagtiff.cpp: undefined reference to `TIFFClose' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x729):imagtiff.cpp: undefined reference to `_TIFFfree' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x768):imagtiff.cpp: undefined reference to `TIFFClose' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x777):imagtiff.cpp: undefined reference to `_TIFFfree'
D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x785):imagtiff.cpp: undefined reference to `TIFFScanlineSize' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x78d):imagtiff.cpp: undefined reference to `_TIFFmalloc' D:/DevCpp/lib/libwxmsw.a(imagtiff.o)(.text+0x7a5):imagtiff.cpp: undefined reference to `TIFFClose'
make.exe: *** [DreamXP.exe] Error 1
Execution terminated
Ok what happened? :P Thanks in advance, ow andum Happy Newyear in 6 hours ;) Tim 2K |
13. Re: wxSplashscreen class question #3156 Posted by: upCASE 2004-01-01 02:19:12 |
Hi! Add
-ltiff -lpng -ljpeg -lzlib
to your linker options. Happy new year, same time here :)
upcaseupCASE ----------------------------------- If it was hard to write, it should be hard to read!- Do. Or do not. There is no try! |
14. Re: wxSplashscreen class question #3157 Posted by: 2004-01-01 02:21:55 |
Ah rite. I haven't got a clue how to do that, but i'll see what i can come up with :P And yup, holland and germany are in the same time zone, i think ^^
Tim 2K |
15. Re: wxSplashscreen class question #3163 Posted by: upCASE 2004-01-01 22:12:17 |
Hi! Open you project settings. Got to the "Parameters" tab and enter the lines I posted below the others that should be there (like -lwxmsw etc.). Close the settings and compile again. The error is that for wxInitAllImageHandlers(); you'll need all image processing libs linked in.
upcaseupCASE ----------------------------------- If it was hard to write, it should be hard to read!- Do. Or do not. There is no try! |
16. Re: wxSplashscreen class question #3300 Posted by: 2004-02-01 19:45:22 |
Hi,
I've followed alone, because I had the same problems.
After following the above directions, I now link, but get an error about
jpeg-62.dll
not being found and then all the paths that it has looked in.
I did a search and found the file in:
c:Program FilesCommon FilesGTK2.0lib
so, I tried adding this directory to the lib search path, but this did not work.
Any other ideas?
Thanks, Patrick |
17. Re: wxSplashscreen class question #4306 Posted by: 2004-06-01 20:54:08 |
Thank you for the information. I was stuck w/ the same problem, it's solved now. |
18. Re: wxSplashscreen class question #4310 Posted by: yeohhs 2004-06-02 10:06:41 |
Hi,
Besides using wxInitAllImageHandlers(), you could also use this:
wxImage::AddHandler( new wxPNGHandler );
This will only add the PNG handler.
Best Regards, Yeoh --
|
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next 1 |