Author Topic: Question on Code::blocks design  (Read 18478 times)

Guest

  • Guest
Question on Code::blocks design
« 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

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Question on Code::blocks design
« Reply #1 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.
Be patient!
This bug will be fixed soon...

Offline frog-o

  • Multiple posting newcomer
  • *
  • Posts: 61
Question on Code::blocks design
« Reply #2 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

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Question on Code::blocks design
« Reply #3 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.

Offline frog-o

  • Multiple posting newcomer
  • *
  • Posts: 61
Question on Code::blocks design
« Reply #4 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.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Question on Code::blocks design
« Reply #5 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.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Question on Code::blocks design
« Reply #6 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.
Be patient!
This bug will be fixed soon...

Offline frog-o

  • Multiple posting newcomer
  • *
  • Posts: 61
Question on Code::blocks design
« Reply #7 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.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Question on Code::blocks design
« Reply #8 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.

Offline frog-o

  • Multiple posting newcomer
  • *
  • Posts: 61
Question on Code::blocks design
« Reply #9 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

Offline frog-o

  • Multiple posting newcomer
  • *
  • Posts: 61
Question on Code::blocks design
« Reply #10 on: May 17, 2005, 06:49:23 pm »
Never mind i figure it out it was an old dll plugin i built

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Question on Code::blocks design
« Reply #11 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:

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Question on Code::blocks design
« Reply #12 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: )
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline frog-o

  • Multiple posting newcomer
  • *
  • Posts: 61
Question on Code::blocks design
« Reply #13 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.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Question on Code::blocks design
« Reply #14 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.
Be patient!
This bug will be fixed soon...