Author Topic: wxSmith - tutorial  (Read 71545 times)

Offline cyberkoa

  • Plugin developer
  • Almost regular
  • ****
  • Posts: 145
    • http://
Re: wxSmith - tutorial
« Reply #15 on: November 15, 2005, 05:54:43 pm »
Quote

Takeshi Miya: Can You describe Black screen more precisely (the most important thing is when it does occur). I noticed this behaviour but have too few informations about that. Maybe some bug report ;)
I found one very obvious black background screen problem in wxNotebook when I do the style update , I hv tried to debug but it seems like quite complicated to me.

Steps to reproduce
1. You can take the wxSmith setting dialog (with wxNotebook)
2. Click on the first tab , click the 2nd tab -> the background turns black.
3. At this moment , if you click on one of the widgets in that panel , the dialog disappear , left the whole windowseditor with black background.

WinXP Pro SP2
wxwidgets2.6.2

Quote
BTW. Can anyone help me with Linux version ? I really have no Idea why it don't want to load :( And Squizz: I've divided by zero and still have exceptions ;)
I have the same problem in Ubuntu 5.10 breezy, the profiler plugins also does not loaded properly.
I notice that there is a corresponding .la file for each plugins library , this should be generated by the autotools. I just wonder , is there anyway to integrate the existing wxSmith code into the automake process just like how the other plugins is built .


I am working on a bug in wxSmith which related to Unicode (I guest), it seems like the resourcedata cannot handle Unicode for Asian Languange, there is data lost during the Adding/Transferring process. 

EDIT: By the way, byo , update for the Styles is completed, I do not only refer to WX_DIR\src\xrc , I also refer to the HELP file because the code in WX_DIR\src\xrc seems like only contain code for WXMSW, missing out some style in WXGTK,WXPALM,WXMAC,WXWINCE .

And the new pallete look for wxSmith is great !:) , just only the the quick position/alignment pallete seems like disappear.
« Last Edit: November 15, 2005, 06:33:05 pm by cyberkoa »

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: wxSmith - tutorial
« Reply #16 on: November 16, 2005, 11:21:48 pm »
question : what do the top 3 buttons on the right hand side do (tested with snapshot build of CB of 16 november 2005) ? Would be nice if there are also tooltips for those buttons.

Thanks,
Lieven

takeshimiya

  • Guest
Re: wxSmith - tutorial
« Reply #17 on: November 16, 2005, 11:35:18 pm »
I was going to ask that, but then I realized that probably that those panels will be managed by wxDockIt

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmith - tutorial
« Reply #18 on: November 17, 2005, 12:24:47 am »
question : what do the top 3 buttons on the right hand side do (tested with snapshot build of CB of 16 november 2005) ? Would be nice if there are also tooltips for those buttons.

Thanks,
Lieven

These should be "insertion type" buttons - from top - insert into, insert before, insert after.
Currently selected (the one with red tick) says where new widgets should be added (relatively to current selection).

Tips are on the way, I just forgot to add them ;)

takeshimiya

  • Guest
Re: wxSmith - tutorial
« Reply #19 on: November 17, 2005, 12:31:08 am »
and the panels are going to be managed by wxDockIt?

The Falcon

  • Guest
Re: wxSmith - tutorial
« Reply #20 on: November 17, 2005, 04:30:59 am »
To BYO:

    I posted a couple of days ago (my appreciation for the recent wxSmith work) and now I'm back, as promised, with further feedback, observations and possible minor glitches. I've got to say that on the whole my play around with wxSmith has been a really enjoyable experience and I have yet to encounter anything which seems a major bug. Please advise, for future reference, whether posting this type of stuff here is appropriate or is formal bug reporting the more desired option?  OK, well I have not by any means been extensive in my testing/playing but I've done a little bit which has led to the obsrvations outlined below. I hope these help in your quest to get wxSmith to a satisfactory stable state. For reference I am using C::B downloaded from CVS about three days ago, with the bundled RC2 MinGW and wxWidgets-2.6.2 on a Win2000 platform. Well let's get to it:

1. When using the preview facility after only defining a panel and a sizer the minimal preview dialog is displayed. The normal 'x' close button doesn't seem to respond. You can still close if you right click on the header and select 'close', so it's a minor annoyance but I suppose the 'x' close button should really work.

2. The hotkey/accelerator key assignments are not displayed in the preview. i.e. No underlines etc. This seems a bit weird as you can happily play with a combo box and buttons etc. in preview but the first time I saw the buttons I thought I'd forgotten to do the old '&' insertion. I hadn't, it just wasn't reflected in the preview.

3. Subsequent to the already identified 'Black Screen Issue' I noticed that this also occurs when you use the border size spin control in the size options panel. It doesn't do it for ever click, just after a few, and it isn't persistent as it usually returns to normal on clicking up or down to the next value.

4. Another one that may be related to the above (but it's really minor) and may help to lead to the source of the problem is that the size anchor tabs (the little black size tabs around the selected control/widget) flicker madly when you have something selected in wxSmith and use the C::B main menu. It doesn't happen for all menus and I struggled to get a consistent respnse but it does happen if you activate a menu then sweep across the menu titles.

5. When using the properties/events pane to define an event handler you are presented with a small dialog to define the event name. If you choose cancel here, instead of defining a name and pressing OK, the event pane does not re-paint correctly. It will re-paint if you go to the properties tab and then return, but I guess that's not really what you intend.

6. I have a more interesting issue with hidden controls/widgets and their usage with wxSmith but I'm not sure if it's a wxSmith issue. It may be related to wxWidgets, and how they work with sizers (I am reasonably new to both wxWidgets and C::B but ancient as far as C++ and RAD GUI interfaces go) so maybe I just need to be pointed at some documentation on how to manipulate hidden widgets in relation to sizers etc. I notice with interest that when you use the properties window to set the HIDDEN property in wxSmith the selected widget is moved to the top of the display and the container/sizer is resized. Also, when hidden, the widget still appears in the preview facility as if it was still visible. Hmmm. this might be a tad confusing to some. Anyway I tried shifting the widget->hide() code around in the source (and re-compile) and did get it to appear in locations other than at the top of the dialog but as yet I have'nt been able to get it to work properly. Most likely it's a product of my relative inexperience with wxWidgets but any light you can shed on this would be helpful, or is it something I should forward to the wxWidgets forum? Have you experienced any difficulties with this issue in the wxSmith implementation?

Anyway that's it for now, hope some of this helps, and keep up the great work,,,,

Kind Regards,
    The Falcon.  :D

PS: Love the widget multi-select property setting. Sort of didn't ecpect it at this stage but there it is, well done.

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmith - tutorial
« Reply #21 on: November 17, 2005, 12:40:29 pm »
and the panels are going to be managed by wxDockIt?

I don't plan it currently because there was discussion about switching to wxIFM. And I'll wait till there's a final dedcission about that :)

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmith - tutorial
« Reply #22 on: November 17, 2005, 01:17:58 pm »
Please advise, for future reference, whether posting this type of stuff here is appropriate or is formal bug reporting the more desired option?

I advise using SF bug reporting system - Ii will be easy to manage them and hard to forget ;)

Quote
1. When using the preview facility after only defining a panel and a sizer the minimal preview dialog is displayed. The normal 'x' close button doesn't seem to respond. You can still close if you right click on the header and select 'close', so it's a minor annoyance but I suppose the 'x' close button should really work.

This seems to be wxWidgets bug or even more - Windows one. I'll se what can be done but now it will be delayed.

Quote
2. The hotkey/accelerator key assignments are not displayed in the preview. i.e. No underlines etc. This seems a bit weird as you can happily play with a combo box and buttons etc. in preview but the first time I saw the buttons I thought I'd forgotten to do the old '&' insertion. I hadn't, it just wasn't reflected in the preview.

I'll have to take a closer look at this. Sometimes I see underline and sometimes i don't :? Really weird ;)

Quote
3. Subsequent to the already identified 'Black Screen Issue' I noticed that this also occurs when you use the border size spin control in the size options panel. It doesn't do it for ever click, just after a few, and it isn't persistent as it usually returns to normal on clicking up or down to the next value.

This bug seems to be a bigger one :( I have some idea but it will require some time

Quote
4. Another one that may be related to the above (but it's really minor) and may help to lead to the source of the problem is that the size anchor tabs (the little black size tabs around the selected control/widget) flicker madly when you have something selected in wxSmith and use the C::B main menu. It doesn't happen for all menus and I struggled to get a consistent respnse but it does happen if you activate a menu then sweep across the menu titles.

Somehow connected with the previous one. I guess it will have biggest proprity assigned ;)

Quote
5. When using the properties/events pane to define an event handler you are presented with a small dialog to define the event name. If you choose cancel here, instead of defining a name and pressing OK, the event pane does not re-paint correctly. It will re-paint if you go to the properties tab and then return, but I guess that's not really what you intend.

That should be easy. I know that there are more situations like this. If You notice any, please notice me :)

Quote
6. I have a more interesting issue with hidden controls/widgets and their usage with wxSmith but I'm not sure if it's a wxSmith issue. It may be related to wxWidgets, and how they work with sizers (I am reasonably new to both wxWidgets and C::B but ancient as far as C++ and RAD GUI interfaces go) so maybe I just need to be pointed at some documentation on how to manipulate hidden widgets in relation to sizers etc. I notice with interest that when you use the properties window to set the HIDDEN property in wxSmith the selected widget is moved to the top of the display and the container/sizer is resized. Also, when hidden, the widget still appears in the preview facility as if it was still visible. Hmmm. this might be a tad confusing to some. Anyway I tried shifting the widget->hide() code around in the source (and re-compile) and did get it to appear in locations other than at the top of the dialog but as yet I have'nt been able to get it to work properly. Most likely it's a product of my relative inexperience with wxWidgets but any light you can shed on this would be helpful, or is it something I should forward to the wxWidgets forum? Have you experienced any difficulties with this issue in the wxSmith implementation?

Nice catch. But this confusing behaviour seems to be wxWidgets one. Other thing is that wxSmith does not do anything to make it less confusing ;). I'v noticed that sizers check what widgets are hidden inside it and when whole row / column of widgets is hidden, it won't be displayed at all and no place will be reserved for them...
I see only one difference in my case - hidden widgets are not moved to the top of the window but they're placed somewhere betwen it's neighbours. Can You post some screenshoot ?

Quote
Anyway that's it for now, hope some of this helps, and keep up the great work,,,,

Thx for Your work :)

Quote
PS: Love the widget multi-select property setting. Sort of didn't ecpect it at this stage but there it is, well done.

Hmm, can You check again ? You have surprised me too  :D But I'll think about it.


The Falcon

  • Guest
Re: wxSmith - tutorial
« Reply #23 on: November 17, 2005, 04:36:58 pm »
Thanks for the response BYO,

    first off regarding my previous PS: about the multi-select property setting, woops  :? I think I got carried away. I re-checked as advised and I was mistaken. This is a very useful feature though, i.e. being able to select multiple (alike) widgets and setting properties (such as font, or foreground colour) that are common to each widget. I can understand though that it would not be a priority in the short term. Perhaps one for the future enhancements basket.
    OK now to the requested info on the hidden widgets issue. This little test was simply an extension of your excellent little tutorial with a few small features changed to allow me to become more familiar with things. I'll outline what I did so you can get a better idea of the real issue.

1. I created a dialog and inserted a box sizer with vertical orientation.
2. I inserted a wxStaticText label followed by a wxComboBox filled with ten items.
3. I then placed another wxStaticText label below this.
4. To be a little more adventurous I placed a wxStaticBox below at the bottom with horizontal orientation, in this I placed two buttons with a spacer in between, just for kicks.

This is how it looks:



as you can see the object is to select from the wxComboBox and see the selection reflected in the wxStaticText widget. This works nicely until you get a bit fancier and try hiding the wxStaticText widget and displaying it only after a selection has been made from the combo. If you hide it directly from wxSmith->Properties-HIDDEN the widget disappears and some outlined tabs are visible in the design area, at the top of the dialog. It looks like this in wxSmith:



Here's what it looks like when compiled and displayed after first combo selection.



If I move the hide instruction (inserted by wxSmith after property setting) down to the bottom of TestDialog::TestDialog which is my constructor in testdialog.cpp then it comples like this:




The code seems to perform all the right functionality but it's just the weird positioning that causes the problem. I think you are most probably on the mark with thinking it may be a wxWidgets problem, but I hope this all makes it a bit clearer for you. I might poke around the wxWidgets site and see what I can find. If I resolve it I'll get back to you.

Incidentaly, do you want me to post this and perhaps the other points I mentioned last time to the SF bug system? Either way I'll try to do it that way from now on. Thanks for your time.

Regards,
    The Falcon.  :D

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmith - tutorial
« Reply #24 on: November 17, 2005, 06:10:39 pm »
Ok, now I see what's here.

Because sizers position this hidden text, it's place is not set when it's hidden flag is set. I'll have to think on really easy way of representing such widgets in wxSmith cause current representation can be really confusing :)

And the second problem - on runtime You have to call Layout() after hiding / unhiding text.

The Falcon

  • Guest
Re: wxSmith - tutorial
« Reply #25 on: November 18, 2005, 03:49:24 am »
BYO,

    Yep, you're spot on with the wxSizer->Layout() suggestion. If I add this call after the wxSmith block of code (in constructor) and also in the event handler that updates the text value, then everything works as expected. Incidentally calling the Show() method on the wsSizer followed by Layout() also works. I'll leave it in your capable hands as to how you implement this in wxSmith at a later stage.
    One other thing did crop up when I was experimenting with this issue. I have a habit (picked up in VB years ago) of renaming the default widget names e.g. BoxSizer1 becomes MainBoxSizer or whatever. I had at one stage added the following inside the wxSmith comment markers; BoxSizer1->Show(stSelected, false, false), followed by BoxSizer1->Layout(). When I changed the name property afterwords in the property dialog (to MainBoxSizer) all the wxSmith generated code was appropriately renamed, however the two calls I had added were gone, deleted, non-existent :o. Ok, well I guess the general rule, at least for the moment, is stay out of wxSmith's code block.  :lol: It's no great drama, it just caught me by surprise. I mean I can't expect wxSmith to go looking everywhere to check if I have used this (changed) name elsewhere. Of course I have to take responsibility for fixing the references/calls in the combo event handler. The point here I guess is that it was the delete that surprised, if it had simply been left alone (or even miraculously renamed as well) there would have been no surprise, but there you go, life is full of surprises. All the best with your development of wxSmith and other endeavours and thanks for your patient assistance with the issues I raised.  :D

Regards
    The Falcon.

Offline RJP Computing

  • Almost regular
  • **
  • Posts: 135
    • RJP Computing
Re: wxSmith - tutorial
« Reply #26 on: January 16, 2006, 04:55:10 am »
What happened to the tutorial. I can't find it. It doesn't appear in the wiki any more.
- Ryan

Ubuntu/WinXP, AMD Athlon 64 3000+, 1000MB RAM, AC 97 Audio, ATI Radeon 9600XT 256MB

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: wxSmith - tutorial
« Reply #27 on: January 16, 2006, 08:34:02 am »
What happened to the tutorial. I can't find it. It doesn't appear in the wiki any more.

http://wiki.codeblocks.org/index.php?title=WxSmith_Tutorial_%26_Pointers
Be patient!
This bug will be fixed soon...

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: wxSmith - tutorial
« Reply #28 on: January 16, 2006, 02:39:52 pm »
I can't find it. It doesn't appear in the wiki any more.
Main page -> "Developing for Code::Blocks" (in table of contents) -> "wxSmith Tutorial & Pointers"
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline RJP Computing

  • Almost regular
  • **
  • Posts: 135
    • RJP Computing
Re: wxSmith - tutorial
« Reply #29 on: January 16, 2006, 03:13:12 pm »
Found it.  :oops: Sorry.
- Ryan

Ubuntu/WinXP, AMD Athlon 64 3000+, 1000MB RAM, AC 97 Audio, ATI Radeon 9600XT 256MB