![]() |
Development Lifecycle »
Code Generation »
General
Beginner
License: The Code Project Open License (CPOL)
RAD C++ Integrated Development EnvironmentBy Ali Imran Khan ShiraniRAD Tool for C++ Developers, Code Generator |
C++, Windows (Win2K, WinXP, Win2003), Win32, Dev, Design
|
||||||||
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||
RAD Studio (aka RAD C++ IDE) is a tool designed specifically to rapid up the development process without hassle of running heavy Integrated Development Environments. RAD Studio concentrates on highly increased level of ease, by provision of inplace GUI Designer as well as event handlers attachment within the IDE. It also lessens the burden by writing event handlers for a range of controls, from normal button upto very sophisticated Grid control. Very first time when it was planned, it was started for gcc-mingw compiler. It is completely based on RAD C++ GUI Library which is now ported to Microsoft Visual C++ too.
Basic Idea was HIGHLY INCREASED LEVEL OF EASE for C++ developers. What RAD Studio produces as code is compilable with DEV C++ without any problem (if v1.2.4 radc++.h and libradc++.a are present in the dev c++ installation folder)
If you start reading the source code you may be lost, becuase to read the code you first must have good grip over the RAD C++ GUI Library itself. So better is user the applciation itself. Secondly if anyone is interested in reviewing the code, is welcomed to ask questions wherever needed. Backbone of RADStudio is RAD C++ GUI Library ofcourse, but files denv.h dform.h and dcontrol.h are very good example of creating your very own dialog designer whih may be utilized in your commercial applciations too.
The code that RADStudio produces is really simple enough to understand, since RAD C++ Library itself concentrates upon level of ease.
Here is a small example of a Dialog / Form designed in RADStudio and then code exported as custom framework:
//Header file for Form1 - Form1.h FormProcedure CForm1_Procedure(FormProcArgs); class CForm1 : public Form { public: Button Button20; TextBox TextBox21; //constructor CForm1(); //Form events void onClose(CForm1 &me); void onFocus(CForm1 &me); void onLeftClick(CForm1 &me, int mouseX, int mouseY); void onLoad(CForm1 &me); void onMouseMove(CForm1 &me, int mouseX, int mouseY); void onRefresh(CForm1 &me); void onResize(CForm1 &me, int newWidth, int newHeight); void onRightClick(CForm1 &me, int mouseX, int mouseY); //Controls' events void Button20_onClick(CForm1 &parent,Button &me); void TextBox21_onChange(CForm1 &parent, TextBox &me, String newText); };
//And corrosponding cpp file for Form1 - Form1.cpp CForm1::CForm1() : Form("Form 1",95,127,400,210,RCP_SIMPLE,True,True,False,False,True,_window(HWND_DESKTOP),False,0) { Button20.create("Button 20",AUTO_ID,238,98,100,25,*this,True,True,False,False); TextBox21.create("TextBox 21",AUTO_ID,28,98,200,25,*this,True,True,False,False,WS_EX_CLIENTEDGE); this->procedure=CForm1_Procedure; SetWindowLong(hwnd,GWL_USERDATA,(LONG)this); this->onLoad(*this); } FormProcedure CForm1_Procedure(FormProcArgs) { CForm1 *FRM = reinterpret_cast(GetWindowLong(hwnd,GWL_USERDATA)); ON_COMMAND_BY(FRM->Button20) FRM->Button20_onClick(*FRM,FRM->Button20); ON_TEXT_CHANGED(FRM->TextBox21) FRM->TextBox21_onChange(*FRM,FRM->TextBox21,FRM->TextBox21.getText()); ON_CLOSE() FRM->onClose(*FRM); ON_FOCUS() FRM->onFocus(*FRM); ON_LEFT_CLICK() FRM->onLeftClick(*FRM,_xmouse,_ymouse); ON_MOUSEMOVE() FRM->onMouseMove(*FRM,_xmouse,_ymouse); ON_PAINT() FRM->onRefresh(*FRM); ON_RESIZE() FRM->onResize(*FRM,FRM->getWidth(),FRM->getHeight()); ON_RIGHT_CLICK() FRM->onRightClick(*FRM,_xmouse,_ymouse); return 0; } /* implementation of event handlers and developer's code */ void CForm1::Button20_onClick(CForm1 &parent,Button &me){ /* Code when button is clicked. */ } void CForm1::TextBox21_onChange(CForm1 &parent, TextBox &me, String newText){ /* Code when text is changed. */ } /* implementation of event handlers and developer's code */ void CForm1::onClose(CForm1 &me) { /* [X] Code when form is closed . */ Application.close(); //remove this line if it is not main form of application } void CForm1::onFocus(CForm1 &me) { /* When form receives focus */ } void CForm1::onLeftClick(CForm1 &me, int mouseX, int mouseY) { /* When left mouse button is clicked */ } void CForm1::onLoad(CForm1 &me) { /* Code when for is very first time loaded. */ } void CForm1::onMouseMove(CForm1 &me, int mouseX, int mouseY) { /* When mouse cursor moves over surface of form */ } void CForm1::onRefresh(CForm1 &me) { /* When surface of form is redrawn */ } void CForm1::onResize(CForm1 &me, int newWidth, int newHeight) { /* Code when form is resized. */ } void CForm1::onRightClick(CForm1 &me, int mouseX, int mouseY) { /* When right mouse button is clicked */ }
//Main program file #define PROJECT_NAME "RAD C++ Studio Project" #includeenum __BOOL { False=0, True=1 };//IDE specific /* Globals go here which are accessible throughout application code */ #include "Form1.h" CForm1 Form1; #include "Form1.cpp" rad_main() rad_end()
It also produces plain C style code that will be too easy for a moderate level C developer to understand, whih means, the framework in the code is not created.
RAD Studio is not integrated with any compiler yet, but the code it produces does compile. Easy things First, Please first obtain a copy of DEV C++ from www.bloodshed.net. Install it. Now obtain RAD C++ GUI Library 1.2.4 DevPak from radcpp.com's main page and install that too. Now start rad c++ open your GUI project you saved, and export throught menus 'Export' -> 'Framework Classes', it will popup folder chooser, you select a folder you want to write project file and code files to, and hit ok. Now open RADCPP_Project.dev compile and run, enjoy the ease.
Interesting thing is, RAD Studio is continously being developed and enhanced, and being made compatible with different c++ compilers time to time, for now what it generates is what exactly it is built upon (i.e. rad c++ gui library). The Library behind it is being updated time ot time, and is planned to be ported to X11-Linux environment as well as Mac OSX. So that we finally will have a free of cost full-fledged IDE for C++ developers to develope GUI applciations rapidly and cross-platform.
| You must Sign In to use this message board. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 7 Jun 2008 Editor: |
Copyright 2008 by Ali Imran Khan Shirani Everything else Copyright © CodeProject, 1999-2009 Web21 | Advertise on the Code Project |