Tech Support Guy banner
  • Please post in our Community Feedback thread for help with the new forum software! If you are having trouble logging in, please Contact Us for assistance.
Status
Not open for further replies.
1 - 4 of 4 Posts

·
Super Moderator
Joined
·
37,519 Posts
Discussion Starter · #1 ·
Hiya

Finally got Borland 6 C++, and what can I say but Yes, far better than version 3. I've just created a balnk form, but with 3 menu's, and buttons, all without programming.

However, I was following the tutorial, and got a bit lost. I was in the Code Editor, and typed in what was in the book, but I was a bit concerned, as in the bottom it said there was an error to the compiler code. Looked at the picture where it said 'it looks like this', and they didn't have it.

I'll try and add it in here, bit by bit,a s to where I am. Will post this bit first, just in case :D

eddie
 

·
Super Moderator
Joined
·
37,519 Posts
Discussion Starter · #2 ·
Code:
//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ActnList.hpp>
#include <ComCtrls.hpp>
#include <ImgList.hpp>
#include <StdActns.hpp>
#include <Menus.hpp>
#include <ToolWin.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:	// IDE-managed Components
        TRichEdit *RichEdit1;
        TStatusBar *StatusBar1;
        TImageList *ImageList1;
        TActionList *ActionList1;
        TAction *FileNew;
        TAction *FileSave;
        TAction *HelpIndex;
        TAction *HelpAbout;
        TEditCut *EditCut1;
        TEditCopy *EditCopy1;
        TEditPaste *EditPaste1;
        TFileOpen *FileOpen1;
        TFileSaveAs *FileSaveAs1;
        TFileExit *FileExit1;
        THelpContents *HelpContents1;
        TMainMenu *MainMenu1;
        TMenuItem *File1;
        TMenuItem *New1;
        TMenuItem *Open1;
        TMenuItem *Save1;
        TMenuItem *SaveAs1;
        TMenuItem *N1;
        TMenuItem *Exit1;
        TMenuItem *Edit1;
        TMenuItem *Cut1;
        TMenuItem *Copy1;
        TMenuItem *Paste1;
        TMenuItem *Help1;
        TMenuItem *Contents1;
        TMenuItem *Index1;
        TMenuItem *N2;
        TMenuItem *About1;
        TToolBar *ToolBar1;
        TToolButton *ToolButton1;
        TToolButton *ToolButton2;
        TToolButton *ToolButton3;
        TToolButton *ToolButton4;
        TToolButton *ToolButton5;
        TToolButton *ToolButton6;
        TToolButton *ToolButton7;
        TToolButton *ToolButton8;
        void __fastcall FileNewExecute(TObject *Sender);
private:	// User declarations
public:		// User declarations
        AniString FileName;
        __fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
Okay, the above was done without coding, and first it says to create an Event Handler, so looking where it was typed, I added this part:

AniString FileName;

near the bottom of the above code.

So far so good. Posting next bit
 

·
Super Moderator
Joined
·
37,519 Posts
Discussion Starter · #3 ·
Doubleclick ActionList (personal edition, I have), then doubleclick the FileNew Action

Then, type this code in

Code:
RichEdit->Clear();
FileName = "untitled.txt";
StatusBar->panels->Items[0]->Text = FileName;
So that it looks like this:
 

·
Super Moderator
Joined
·
37,519 Posts
Discussion Starter · #4 ·
Hang on, just tried it and it works :confused:

I wonder if I clicked the wrong filenew button. What I was doing, was typing in the RichEdit then did a - followed by a >, and a box appeared. I ignored it, and continoued typing as suggested, and it said Error at the bottom.

Anyway, will keep plodding thru. It is nice, did all the above without typing one bit (the long code) :)

eddie
 
1 - 4 of 4 Posts
Status
Not open for further replies.
Top