wxArtProvider

BlitzMax Forums/Brucey's Modules/wxArtProvider

TaskMaster(Posted 2013) [#1]
This module no longer returns the Operating System default icons.

I used to be able to feed the wxArtProvider.CreateBitmap wxArt_New and get the system default icon for "New File". These no longer work, they just cause an error.

Your sample only uses wxArt_Error and wxArt_Question. Only a very small selection of them actually work, but they used to ALL work. Is this something broken, or is this by design and I should add my own icons now?


TaskMaster(Posted 2013) [#2]
The wxART_ERROR icon works, and a couple others. But no other ones. The sample notebook app does not have this problem and all of the icons work.

This is very strange. Can someone think of a reason this would be? Maybe something not getting initialized in the right order in my program?


TaskMaster(Posted 2013) [#3]
Hmmm, it works if I do a Framework wx.wxApp at the top of my program.

What exactly is going on there that might require that? Any ideas?


Derron(Posted 2013) [#4]
To find out without looking at to much code (but therefor have more compilation runs):
- load wxapp source
- import the same modules as wxapp
- if that displays your icons: remove an import each time and check until icons get not displayed anylonger
- load the just removed import source
- repeat the steps above until you got the source file doing the magic
- narrow it down by looking through that code.


bye
Ron


TaskMaster(Posted 2013) [#5]
Ah, thanks, I will give this a shot. I hadn't really thought it all the way through, in what Framework might be doing vs. Import.


Derron(Posted 2013) [#6]
If importing all "wxapps-imported" modules does not help and you still miss the icons: it is in the wxapps-source-file.

Good luck :p.


bye
Ron


Brucey(Posted 2013) [#7]
Maybe the consts have changed (as they like to do, rather often)…

I'm looking into it.


Brucey(Posted 2013) [#8]
What happens when you run this? :



UNZ(Posted 2013) [#9]
Hello,

I didn't wanted to open another thread so...
It looks like wxArtProvider has some issues at the current revision (758).

here is a slightly modified version of the sample


This throws an error because he can't find the bitmap for ART_FOLDER.
The other bitmaps aren't changed as well.


Brucey(Posted 2013) [#10]
Hmm. I just tried your sample on OSX and XP, and it ran without problems.

What error do you get exactly?


UNZ(Posted 2013) [#11]
You're right. I just tested it on my linux laptop and it runs perfectly.
But my windows 7 says



because the bitmap isn't loaded by the art provider I think.

PS:
thx for the bmx lexer stuff


UNZ(Posted 2013) [#12]
I just tried older revisions.
The error occurres since rev 757.


TaskMaster(Posted 2013) [#13]
Brucey,

Sorry I never got back in here to respond after finding a working solution to my problem.

Your code in post #8 works fine.

Thanks.


UNZ(Posted 2013) [#14]
Hey there,

I wonder how the wxGenericDirCtrl gets the icons for files (on windows it is the system default for each extension ~> pretty nice). I wanted to write a dir ctrl that doen't show the complete filesystem but starts at a given path. This is simple but it would be nice to show the correct icon for file extensions like the wxGenericDirCtrl does. Is this possible with wxMax?

Otherwise I think I make an icon for textfiles,images,audio,executables and others. But that is not as intuitive for the user.


Brucey(Posted 2013) [#15]
Is this possible with wxMax?

Well, you could look at the wxWidgets source and see where it gets them from, and implement something similar for yourself? :-)


Brucey(Posted 2013) [#16]
It looks like there is an internal wxFileIconsTable class, which has a GetIconID() method to do some magic with mime types.


UNZ(Posted 2013) [#17]
Nee. if code blocks does not need this, i don't either. ^^


Derron(Posted 2013) [#18]
You would only have to do this for "listed file types" - so once it is done (getting icons for filetypes) it is not much workload for the app to retrieve the icon for a file.

"Nee" - shouldn't this be "Nah" or "Nope". "Nee" sounds like German dialect ("Nee Danke" / "Nah, thanks!") :p.


bye
Ron


UNZ(Posted 2013) [#19]
Derron you're quite a detective... I thought "Nee" would also be english. Nah, whatever :)


Derron(Posted 2013) [#20]
Maybe it is based on the "Der" in "Derron" being an article :D.


Feel free to have an updated "worklog"-thread in the forum so we know what is happening at the development front. I am always interested in reading things I tried some day in the past or want to try in the future (that is why I enjoyed to read Bruceys steps in qt-wrapper-writing, but he suddenly stopped...).


bye
Ron


Brucey(Posted 2013) [#21]
but he suddenly stopped…

… because he tends to get distracted by his many other BlitzMax-related projects.

For example, I've been doing a lot of new wxMax stuff this week.
The other week I thought I'd make a Star Wars scroller using Cairo…

So there's lots to distract me :-p


Derron(Posted 2013) [#22]
But you may write about your experiments (if they build up interesting facts/knowledge) - then I also would read your other dev-stories.

And I know that distraction problem (opening older parts of a project...seeing the "garbage", saying "have to recode that with a way better approach" to myself, forgetting to finish code of another project until that recode is done ... while there is a huge chance to get another distraction).


bye
Ron


Brucey(Posted 2013) [#23]
But you may write about your experiments

Well, I just spent 4 or so hours trying to work out how to generate and catch app suspend/resume events.
One of those times where you write some code somewhere and think - "that looks like the right place to do it" - and it then doesn't appear to do anything. So you debug, and debug some more. Then you think maybe you missed something else, so you add a bit of extra code somewhere, and now the whole thing crashes on startup every time. Ah… great. Then you spent some hours digging and digging until you eventually track it down, and you add one line of code into the glue, and your original code (which you thought should work) now works as expected.

Not sure if it's interesting or knowledgeable :-p


Derron(Posted 2013) [#24]

Not sure if it's interesting or knowledgeable :-p



No :D

Why? This is happening to all of us... writing things which do not work as intended...writing more support code to find out why or to circumvent a potential bug - and after all you find a line which eg. disables a special behaviour and you finally found the reason why your very first code was not working. (Okay, that glue-code thingies are working one level lower on the surface and pointers/interaction-with-c is way more foggy concerning bug hunting)

bye
Ron


Brucey(Posted 2013) [#25]
This is happening to all of us…

Pah! I expect most things to work first time :-p


UNZ(Posted 2013) [#26]
@Derron

Feel free to have an updated "worklog"-thread in the forum so we know what is happening at the development front



If this was addressed to me I suggest you have a look at the idevIDE svn logs and the "todo.txt" file. Isn't there even an option to "subscribe" a project so you get a mail when a commit was done?


Brucey(Posted 2013) [#27]
Commits are not as interesting as someone writing "Today I added this and that, and wondered what to do next" :-p


Derron(Posted 2013) [#28]
hmm what is more interesting:

Man this was interesting, completely overhauled the handling of thing xyz and this improved readability (nice for you modders!) and made further expansions way easier. Also a tip for you: a custom event system is really really helpful and allows for easy connections between modules which do not have to know..

or



bye
Ron

edit: code 2 codebox