some questions about design

This is a discussion on some questions about design within the C++ Programming forums, part of the General Programming Boards category; hi, i've started a project that can write GUI application in standard c++. it is very simple now. my question ...

  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    127

    some questions about design

    hi, i've started a project that can write GUI application in standard c++. it is very simple now.
    my question is how you want to design such a framework, what features would you want.

    in fact, there are many many framework about GUI, such as MFC, wxWidgets, but these librarys are usually built as a big, highly polymorphic hierarchy of class. it is a reason that i don't like them.

    somebody told me that implementing a base class--as MFC's CObject--is necessary, it is a base of a framework, in order to use rtti. but i don't think so, i think this is a reason for hard to study, so i've implemented my library with c++ templates.

    what do you think of it?

    thanks for any help
    Nana C++ Library is a GUI framework that designed to be C++ style, cross-platform and easy-to-use.

  2. #2
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    hi, i've started a project that can write GUI application in standard c++. it is very simple now.
    That's really amazing, as there is no way to generate graphics or read the mouse, in ANSI/ISO standard C++

  3. #3
    Registered User MathFan's Avatar
    Join Date
    Apr 2002
    Posts
    190
    how you want to design such a framework
    I personally would have chosen classes. i have actually designed several such GUI-s for my OpenGL projects.

    what features would you want.
    I would have liked it to be flexible and able to perform different tasks - both for the serious app-s and for a more game-orientated software. Simplicity and clarity of different functions and ways of implementing your GUI in my projects will of course mean much. If you ask me it should be cross-platform. Since I'm doing much game programming and besides that like nice design, I would have liked to have some skin or theme feature.

    so i've implemented my library with c++ templates
    Here I'm not sure I understand you. What do you mean with templates? Wouldn't that too involve OOP and classes?

    It will help if you post some code or examples.
    The OS requirements were Windows Vista Ultimate or better, so we used Linux.

  4. #4
    Registered User
    Join Date
    Aug 2003
    Posts
    127
    Quote Originally Posted by DougDbug
    That's really amazing, as there is no way to generate graphics or read the mouse, in ANSI/ISO standard C++
    sorry, I just mean that write GUI with the syntax of standard c++
    so it is portable to each c++ standard conforming compiler. and cross-platform is to be targeted
    Nana C++ Library is a GUI framework that designed to be C++ style, cross-platform and easy-to-use.

  5. #5
    Registered User
    Join Date
    Aug 2003
    Posts
    127
    I personally would have chosen classes. i have actually designed several such GUI-s for my OpenGL projects.
    I think OpenGL is difficulty to me. The library I started is just that creat common controls.

    Here I'm not sure I understand you. What do you mean with templates? Wouldn't that too involve OOP and classes?

    It will help if you post some code or examples.
    yes, i don't like to involve a big class hierarchy.
    thanks for your help. there are some examples at http://wvl.sourceforge.net/. i tried my best to set out what style program with my library
    Nana C++ Library is a GUI framework that designed to be C++ style, cross-platform and easy-to-use.

  6. #6
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    I think that GUI frameworks are actually well suited to the large class hierarchy model. Granted, depending on what one intends to do with the GUI, it is quite possible to have large branches of the hierarchy tree which are totally useless for the given application, and make the library seem bloated. What makes a GUI framework well suited for this model, though (in my opinion), is that GUI widgets (or other associated objects) are the types of things that you'll want to extend or modify just a little bit, so you can grab most of your functionality from the base class, and then just tack on the little bit extra you need without much hassle.

    Granted, it should be considered what needs to be in the tree. i.e. a) what constitutes a general enough derivative from the base class to warrant a place in the framework, instead of letting the user do it themselves, b) what could be in a class, and could simply go unused if the user didn't want it without breaking any design policies, etc.
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

  7. #7
    Registered User
    Join Date
    Aug 2003
    Posts
    127
    thanks for you point.

    I tried my best to make the widgets look like independent. There is not any relationship between them, as the relationship between std::vector and std::deque, we just think they are containers.

    Still and all, I implemented a ctl_interface Abstract Base Class to let the every widget in a container.
    Nana C++ Library is a GUI framework that designed to be C++ style, cross-platform and easy-to-use.

  8. #8
    Registered User
    Join Date
    Aug 2003
    Posts
    127
    My target is that making the widgets look like independent, but i still use a ABC to refer to instance of all the kind of widgets. in fact, i can remove the ABC, use class template to implement it as well, like boost::any.
    For my target, Is it necessary to use class template instead of ABC?
    Nana C++ Library is a GUI framework that designed to be C++ style, cross-platform and easy-to-use.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. some design questions
    By l2u in forum C++ Programming
    Replies: 19
    Last Post: 04-04-2008, 01:39 PM
  2. A very long list of questions... maybe to long...
    By Ravens'sWrath in forum C Programming
    Replies: 16
    Last Post: 05-16-2007, 06:36 AM
  3. Implementing Inheritence into your design
    By bobthebullet990 in forum C++ Programming
    Replies: 6
    Last Post: 08-05-2006, 05:40 PM
  4. Trivial questions - what to do?
    By Aerie in forum A Brief History of Cprogramming.com
    Replies: 23
    Last Post: 12-26-2004, 09:44 AM
  5. are you bored? (interiour design questions)
    By maes in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 01-04-2004, 04:51 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21