Project Examples are included in the ZIP package in folder 'projects'
Introduction
RAD Studio (aka RAD C++ IDE) is a tool designed specifically to speed up the development process without the hassle of running a heavy weight Integrated Development Environment. RAD Studio concentrates on highly increased level of ease, by providing an in-place GUI Designer as well as event handlers attachment within the IDE. It also lessens the burden of writing event handlers for a range of controls, from normal buttons to very sophisticated Grid controls. This project was originally designed for use with the gcc-mingw compiler. It is completely based on RAD C++ GUI Library which has also been ported to Microsoft Visual C++.
Background
The basic idea behind RAD Studio was to provide a HIGHLY INCREASED LEVEL OF EASE for C++ developers. The code produced by RAD Studio 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.
Using the code
If you start by reading the source code you will likely get lost, because it depends heavily on the RAD C++ GUI Library itself. It is much easier to examine an application. If anyone is interested in reviewing the code, please feel free to ask questions wherever needed.
The backbone of RADStudio is the RAD C++ GUI Library, of course, but the files denv.h, dform.h, and dcontrol.h are very good examples of how to create your own dialog designer which can be used in your commercial applications as well.
The code that RADStudio produces is plain C-style code that is easy for a moderate level C developer to understand, since RAD C++ Library itself concentrates upon ease of use. Here is a small example of a Dialog/Form designed in RADStudio and then code exported as custom framework:
FormProcedure CForm1_Procedure(FormProcArgs);
class CForm1 : public Form {
public:
Button Button20;
TextBox TextBox21;
CForm1();
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);
void Button20_onClick(CForm1 &parent,Button &me);
void TextBox21_onChange(CForm1 &parent, TextBox &me, String newText);
};
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 <cform1 /> (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;
}
void CForm1::Button20_onClick(CForm1 &parent,Button &me){
}
void CForm1::TextBox21_onChange(CForm1 &parent, TextBox &me, String newText){
}
void CForm1::onClose(CForm1 &me) {
Application.close();
}
void CForm1::onFocus(CForm1 &me) {
}
void CForm1::onLeftClick(CForm1 &me, int mouseX, int mouseY) {
}
void CForm1::onLoad(CForm1 &me) {
}
void CForm1::onMouseMove(CForm1 &me, int mouseX, int mouseY) {
}
void CForm1::onRefresh(CForm1 &me) {
}
void CForm1::onResize(CForm1 &me, int newWidth, int newHeight) {
}
void CForm1::onRightClick(CForm1 &me, int mouseX, int mouseY) {
}
</cform1 />
#define PROJECT_NAME "RAD C++ Studio Project"
#include <radc++.h />
enum __BOOL { False=0, True=1 };
#include "Form1.h"
CForm1 Form1;
#include "Form1.cpp"
rad_main()
rad_end()
</radc++.h></radc++.h />
Compiling RAD Studio generated Code
RAD Studio is not integrated with any compiler yet, but the code it produces does compile. Please first obtain a copy of DEV C++ from www.bloodshed.net and install it. Then obtain the RAD C++ GUI Library 1.2.4 DevPak from radcpp.com's main page and install that too.
Once both are installed, start RAD C++ and open a GUI project you saved. Export your project using the menus Export | Framework Classes
, select a folder to write project file and code files to, and hit Ok
. Now open RADCPP_Project.dev, compile and run, and enjoy the simplicity.
Point of Interest
RAD Studio is continuously being developed and enhanced. It is being made compatible with additional c++ compilers, but for now the code it generates is exactly what it is built upon (i.e. rad c++ gui library). The library behind it is also being updated from time to time and a port to X11-Linux environment as well as Mac OSX are planned. We hope to finally have a free, full-fledged IDE for C++ developers to develop GUI applciations rapidly and cross-platform.
Important
RAD Studio is still a work in progress. WHY? because I have been concentrating on completing the RAD C++ GUI Library. Some additional effort is needed to make it full-fledged IDE. In general it seems to be stable, but if it crashes, please notify me by posting message to this article so that I can fix it.