Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: Guest on May 09, 2005, 06:14:27 pm

Title: Question on Code::blocks design
Post by: Guest on May 09, 2005, 06:14:27 pm
I been looking at code::blocks soucecode for over a week now and am ver puzzled over  it.  AND WOUNDER IF YOU COULD HELP ME UNDERSTAND the following.

*Why you  don't useing sizer on creation of mainframe and if i sould try to convert it over to use sizer?(mabe this is not possible)

*Why wxMainFrame is useing wxframe in the message map when it is derived from wxParentFrame?

*why when i rem out the everthing in fuctiion
 
void EditorManager::OnTreeItemActivated(wxTreeEvent &event)

(when running windows version of codeblock)

in edditorManeger.cpp it still open file buy double clicking the tree.

The sourcecode Im useing is from the cvs version I updated yesterday morning.   I'm compiling with wxwidgets 2.6.0.

Please note I'm trying to help fix the MDI-BUG That why I'm Asking these questions.

These dosen't reale belong here but i would like you to also notice
you open a file there is (no restore down button,no close, or no minmize button)  I want to find out why?

Thankfor any help
Frog-0
Title: Question on Code::blocks design
Post by: mandrav on May 09, 2005, 10:06:56 pm
Quote
*Why you don't useing sizer on creation of mainframe and if i sould try to convert it over to use sizer?(mabe this is not possible)

What do you want the sizer for? We 're using a wxLayoutManager IIRC.

Quote
*Why wxMainFrame is useing wxframe in the message map when it is derived from wxParentFrame?

Maybe it's just left-over. No big deal though because wxFrame is an ancestor of wxMDIParentFrame...

Quote
*why when i rem out the everthing in fuctiion ... etc ... etc

Because the EditorManager's tree is the "opened files list". The project tree belongs to the ProjectManager.

Quote
Please note I'm trying to help fix the MDI-BUG That why I'm Asking these questions.

Good luck hunting it down. Though, I must say, that I don't see using wx2.6.0 in the near future because, under linux, codeblocks misbehaves badly with it...

Yiannis.
Title: Question on Code::blocks design
Post by: frog-o on May 11, 2005, 03:38:19 pm
In my following

Quote

*Why wxMainFrame is useing wxframe in the message map when it is derived from wxParentFrame?  

 
you put
Quote

Maybe it's just left-over. No big deal though because wxFrame is an ancestor of wxMDIParentFrame...

 
what do you  buy left leftover.  Is it a least a litte bit of A Deal ,becuase it would only have the event of wxFrame and not wxMDIParentFrame.  Wich would me it would be posible that some event would be skip would it  or i'm I wrong in this thinking?

Quote

What do you want the sizer for? We 're using a wxLayoutManager IIRC.

 
Write here Is a big artical of dissucion  I'm not very fimarilar with wxLayoutManager IIRC and look to ME like an absolette class because it for MDI which wxwidgets doc. sayes is an obsollet interface).  Not only that I never see it  use in there samples.  I also want to see if I can't Make class MAINFRAME an XRC to simmplify code will inccressing flexibility.  Size you can use it xrc  but with wxLayoutManager you can't.  before take a hack saw and cutiting out vital organ of a program i figure I better see if you hand a good reson for doing want you done or if you would mind my changes.

I just had not gotten to the part of asking you if you mind it if i try to make Mainframe an XRC.  My thinking is that i can make an xrc for wxframe and have it load into wxMDIParentFrame with wxXmlResource::LoadFrame().  I Have not done any testing on this idea and don't know if it going to work but i think it sould becuse wxframe is a decendent of wxMDIParentFrame.

Any though are well to come. :D
Title: Question on Code::blocks design
Post by: rickg22 on May 11, 2005, 05:35:20 pm
AFAIK there's no wxLayoutManager, instead we have wxSashLayoutWindow's. A solution for the layout problems(?)  is to replace the wxMDIParentFrame with wxFrame, and turn the cbEditor (or EditorBase actually) into wxScrollingWindow instead of wxMDIChildFrame.

Then we can use wxSplitterWindows for the layout, and a wxNotebook for the editors, so everything in XRC.

I guess we haven't asked anyone to try to do that, but once beta8 is released (which i really hope it's this week *ahem* :P ), we'll switch to a single frame layout.

BTW, if anyone wants to experiment and try to do the conversion for us (we'd be REALLY grateful!), he's welcome to do so.
Title: Question on Code::blocks design
Post by: frog-o on May 15, 2005, 12:00:27 am
Just a littlle note on my work.
I try to do alot of conversion today to make mainframe xrc comptible but running into problems.   Like some of the message maneger class don't create new wxpanel control but derive from them and are not verry xrc compatible so don't expect anything from me soon.
Title: Question on Code::blocks design
Post by: rickg22 on May 15, 2005, 05:36:38 am
try instead to make cbEditor wxNotebook compatible... that's the hardest part. Also, the MessageManager isn't a dynamic class (as declared in the wxwidgets manual), it doesn't include the IMPLEMENT_DYNAMIC_CLASS() and DECLARE_DYNAMIC_CLASS() stuff. That's the only thing you need to make it xrc compatible.

But there's something important. MessageManager is a fundamental part of the app, so making it dependant on XRC is a bad idea, IMO. If you want to make everything XRC compliant, you'd have to split the MessageManager class into some "hidden" class and the visual (XRC) part.

Of course, that'd have to be done with the program manager and editor manager.... i simply think the current C::B infrastructure isn't XRC ready yet.
Title: Question on Code::blocks design
Post by: mandrav on May 16, 2005, 10:33:14 am
Quote
AFAIK there's no wxLayoutManager, instead we have wxSashLayoutWindow's.

This is true. I was experimenting with wxDockIt at the time, which has a wxLayoutManager  :oops:
Sorry for the wrong info.

Yiannis.
Title: Question on Code::blocks design
Post by: frog-o on May 16, 2005, 04:11:30 pm
Please forgive me if i say something stupid i have a hard time following you are a bit over my head.  But my desing i don't think it to big of a worry.  I was going to make a setNotebook method for message maneger,  program manager , and  editor manager and make so you can create componets buy xrc or  text.  I played around with this all day sunday and saturday and think i got most of it converted.  My main problem as of now is gitting mainframe to show the xrc componets.  I got must other stufff working I think I can't see them so i can tell.  But it compiles and run with no error when i rem out createToolbar for some reson it cuase it to crash.  I Am curttly back traceing (download source with out any changes) and trying again to convert it to xrc again.  The reson I rather convert it to xrc  is becuase you got alot of work to switch mainframe over to use sizers(wich as far as i know you have to do in order to add a notebook).  I Rather take this energy and put it toward xrc compatibilty.
Title: Question on Code::blocks design
Post by: rickg22 on May 16, 2005, 11:34:19 pm
Please verify that the XRC setup is done *BEFORE* creating the mainframe. Also Check out the code that uses XRC.
Title: Question on Code::blocks design
Post by: frog-o on May 17, 2005, 06:09:51 pm
I think i make greate progress on this.  After i coverted class MainFrame to wxframe it show a meesage box that sayes
"zn7maneger3getEp16wxMdiParentFrame Could not be located in dynamic link libbary codeblock.dll"

and then shortly crashes i think it is becuase of this.

I try to figure out were it is getting wxMdiParentFrame I get rid of all mettioning of it in code.  I test to see if i got rid of all mettiong of wxMdiParentFrame with the seach tool.  the only file that had this text was codeblocks.RPT  witch look like and error log.

Any ideas

It would realy spped up the porogress of what i'm doing if you could tell me. thanks
Title: Question on Code::blocks design
Post by: frog-o on May 17, 2005, 06:49:23 pm
Never mind i figure it out it was an old dll plugin i built
Title: Question on Code::blocks design
Post by: rickg22 on May 17, 2005, 08:01:00 pm
We should add that to the FAQ, as in "my codeblock crashes!" and we should add a * Did you happen to make a DLL plugin for it? :lol:
Title: Question on Code::blocks design
Post by: David Perfors on May 17, 2005, 11:10:51 pm
That is a good idea, because this made me thinking of using the right dll/libs. (I had the same kind of problems for two projects of mine :lol: )
Title: Question on Code::blocks design
Post by: frog-o on May 18, 2005, 06:07:31 pm
I made progress today.  I can now load codeblock with no error on load and open files and have them apear in notebook insted of mdi and i'm useing xrc.  But and this is sa big but, it has many error,  every time i try something from the menu it does want i want once then jams up.  It also dose not close right.  

This is a question for mandrav......

Would you like me to try to create a patch of my changes and said it to you so you could put it in the the cotribu dir?

I could use help on this if anyone intereseted.
Title: Question on Code::blocks design
Post by: mandrav on May 18, 2005, 07:08:50 pm
Excuse me frog-o but I can't understand what you 're trying to achieve...
Maybe I got it all wrong and the following don't make any sense, but they 're based on my understanding of what you 're saying.

XRC is used everywhere in C::B, except the MainFrame (which uses XRC for menubar and toolbar). There's a reason for this: the main frame isn't something that I will decide how to structure. It is up to the user to configure it to his/her liking. I don't see what good it would do to use XRC for the main frame...

Also consider the fact that, at some point, a docking windows library is going to be used (wxDockit/wxIFM). I will have to pass this library an empty frame for it to manage. XRC doesn't fit in the picture...

About using notebook instead of MDI: this is a work-in-progress. We 've stated that we will revert to notebook and drop MDI because it's causing us major headaches with wx2.6.0. Besides the fact that MDI is an obsolete technology (and appears as notebook under linux, anyway)...

Did I understand you or not?

Yiannis.
Title: Question on Code::blocks design
Post by: rickg22 on May 18, 2005, 07:09:18 pm
Define "many error", "something from the menu", "jams up" and "not close right".

Keep in mind that cbEditor is supposed to be a descendant of wxEvtHandler, maybe some events are mishandled?

IMO you're doing the heck of a lot trial and error in here. Not that you're doing bad, but... kinda spooky changing things without knowing how they work (um, what happens if i press this button on the alien spaceship? :P ).

Also, what happened to the "maximize", "restore" and "activate" functions of EditorBase (inherited from wxMDIChildFrame)? Did you emulate them too?
Title: Question on Code::blocks design
Post by: frog-o on May 19, 2005, 03:58:29 pm
mandrav
you said

Quote

There's a reason for this: the main frame isn't something that I will decide how to structure. It is up to the user to configure it to his/her liking. I don't see what good it would do to use XRC for the main frame...


what better way to do this then xrc.    Xrc has many beniffit to it just read wxwidget xrc doc.    .I would like to do thing more visually then type every thing out in text.  It Takes me much long to do thing this way.  Most of the time becuse of trill and error with sizers in wxwidgets.  This would also alow use to edit it in codeblock when we get xrc editing up and running.

and you also said

Quote
Also consider the fact that, at some point, a docking windows library is going to be used (wxDockit/wxIFM).


Yes I consider this and every good libbary sould soport xrc.  I seen you on you toolbar add on createing you own xrchandlers why cant we create one.

My Main worry is such thing as pointer to wxtree controls and other controls but think this can be workaround buy getting everthing to use just plant wxControl.

Alot of xrc access if base on finding a window buy name and can be place anywere in the Mainframe or any of it decendents.
Title: Question on Code::blocks design
Post by: frog-o on May 19, 2005, 04:06:11 pm
to RESPOND TO  commont  rickg22.
That was
Quote

Define "many error", "something from the menu", "jams up" and "not close right".  

 
I said alot of error cuase i don't know them all.  I still bug huntting.  This was just to say i'm not complete with what i'm working on.

I think to see all the bug you need to have the source that i working on.  It hard fo me  to track down and explain all the odd behave yours.
Title: Question on Code::blocks design
Post by: rickg22 on May 19, 2005, 06:45:41 pm
Just a question that crossed my mind. Your changes make C::B behave as "tabbed editors", or you're trying to implement XRC with MDI?

Because trying to manage MDI with XRC is, IMHO, very inconvenient and filled-with-difficulties, if not impossible.
Title: Question on Code::blocks design
Post by: frog-o on May 19, 2005, 07:14:14 pm
Quote

 Your changes make C::B behave as "tabbed editors", or you're trying to implement XRC with MDI?


I been try to say for the longest time.   I have it C::B working with tab editors using my xrc way.  It was easer for me to do it with xrc.  It has some bug but I think it would works if i could get the other problems solved.  C:B crash on close menu problems etc.

I hope mandrav will see the xrc can be flexible and do want he want or explain to me why it is a big problem.

I think i see want he getting at.  Now I hope he can see want i getting at.

I think my idea enables for faster devlopment of c:b.
[/quote]
Title: Question on Code::blocks design
Post by: rickg22 on May 19, 2005, 08:02:39 pm
Sorry for my misunderstanding. What i meant to say was:

Did you try *first* to convert to tabbed editing, *BEFORE* converting to XRC?

From tabbed editing to XRC, it's a straightforward step. At least IMHO (just replace the wxsashlayout windows with normal panels using wxsplitterwindows).

And yes, I agree that XRC is the way to go. In fact I think it'd match perfectly with the personalities management Yiannis is working on.
Title: Question on Code::blocks design
Post by: frog-o on May 20, 2005, 01:39:52 pm
I tryed to do that as much as possible when first started but had problems One was that i cange the name in wxglade of the class feild and cuase an error on xrc load took me a while to track down.  (Dumb me).  Another was an oll dll (dumb me)  and there many others.  I Probbly should try again.  

Here a thought that came to me, i want to try latter what happen when you add a wxframe control to a wxNotebook?  I use wxpannel before on notebooks.  I think it only requiers wxwindow decendent but not sure.      

Here a little more info on my idea inspire buy my brother and mostly his idea for another program i was working on.  

We could have codeblocks load and mange theme wicth are xrc with a possible plugin to mannage the non-stander controls events and other stuff.

I not sure if you can mannage events of mainframe controls outside the Mainfuction thou a dll thou but think you could.

we could have make thing like editormanager have a SetEdtorList(wxTreeCtrl *EditorListCtrl) and SetCustumListCtrl(wxControl *) Methods to do this if it did not work.

mandrav buy the way to answer you question a while back that was
Quote
Did I understand you or not?


Only partarly.  Yes I want mainframe TO BE XRC but you don't understand how i plan on implementing it.

mandrav If I get something work would you like it,  Now that I expplain it a little better or do you still think it will cuase problems?  I got to amit i never usesed (wxDockit/wxIFM) so i could be missing some facts
Title: Question on Code::blocks design
Post by: frog-o on May 21, 2005, 07:22:46 pm
Hay mandrav  I got your note on that was
Quote

A note to frog-o:
I appreciate all the hard work you 're doing, but I think you 're trying to do too many things at once (notebook, xrc, etc). I believe it would be better to do one thing at a time. For example, work on converting MDI to notebook and when you 're done, send me a patch for it. Then continue with the next thing on your checklist (like xrc for main).
It's easier for you to debug your code this way and for me to review the patch...

Yiannis.

I must say I agree that i try to do to much at one time but i belive i do a good job at it.  In fact I almost have all my XRC code::blocks working now. I Think i only have few bugs and some minnor issue with your help i sure i can get them fix.  In reallty i not changing much code just makeing it easyer to use with xrc.   The Menu proble has been fix what done me in was the fact i had -1 in the event id custrutor of mainframe with cuase a bunch of errors.  I delete the section :wxframe(wxParent,-1) becuase it no longer needed.     My only problem now that i know of cunsit of what look to be  5 minnor thing

1 the tree contol right click in linux need to be taken care of
2.  todoplugin crash the ide when the EVT_PROJECT_CLOSE is called
3. the code:block hang on close but exit the onApplication close fuction
4.  a .rc can't be found error i think radomly appers on close (i going buy memorry of my errors)
5. i have not test on linux or with the 2.4 wxwidgets sdk i'm useing 2.6

i just replace were it sayes wxtoolbar * my control = new wxtoolbar() stuff with (wxToolBar *)MainFrame->Findwindow("Testtoobar");  I try several time to do it the way you sugeted but it is much easer this way.  
when you replace wxshashwindow you with wxspliter you realy have to redesing tho hole thing in text.  Add chace down a buch of error becuse of that that you don't get with the way i doing it.
Title: Question on Code::blocks design
Post by: mandrav on May 21, 2005, 08:55:28 pm
Alright. Enough talking. Send me a patch when you 're ready ;)

Yiannis.
Title: Question on Code::blocks design
Post by: frog-o on May 23, 2005, 05:31:54 pm
Not to be a pain mandrav,

But i realy think you sould create an unstable branch of codeblock for my work seperate for the code::block branch.   I don't know what you have agaist it.  Is it hard to create a different branch?

Please note also i starting form scatch today to try to implement it your way (that is Just try to add a notebook first).  I was think about this add i don't think that i need to conver the sash window over right away to splitterwindows wicth would cut down my bug hutting makeing it duable.