Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How to work with Turbo Vision?

netgertnetgert Posts: 331Member
I can't understand of Turbo Vision. Can anybody help me? By the way, I'm newbie.


«1

Comments

  • zibadianzibadian Posts: 6,349Member
    : I can't understand of Turbo Vision. Can anybody help me? By the way, I'm newbie.
    :
    :
    Sure, although it's been a while since I worked with it, but I still know how to create basic programs with it.

    What would you like to know?

  • netgertnetgert Posts: 331Member
    : : I can't understand of Turbo Vision. Can anybody help me? By the way, I'm newbie.
    : :
    : :
    : Sure, although it's been a while since I worked with it, but I still know how to create basic programs with it.
    :
    : What would you like to know?
    :
    How to create new views? How to set their palette? How to make them dragable?

    [b]From [blue]NetGert[/blue] [red] (NetGert@Programmers.2ndmail.com or Netgert@hot.ee)[red][/b] [code];-)[/code]


  • some1some1 Posts: 19Member
    what's turbo vision?


  • zibadianzibadian Posts: 6,349Member
    : what's turbo vision?
    :
    :
    Turbo Vision is a text-based Windows-like appearance for Pascal programs. If you have Borland's Turbo Pascal 6.0 to 7.0, then you see Turbo Vision working, since the IDE of these versions are written in the previous pascal version.
    Maybe other pascal versions also have this appearance, but I haven't seen them. Of the two I have given, I am certain.

  • zibadianzibadian Posts: 6,349Member
    A view is quite difficult to create. Here is some code to get you started:
    BEWARE: THIS CODE IS UNTESTED!!!
    The parts in the [] are optional.
    [code]
    type
    TMyView=object(TView)
    SomeText:string;
    constructor Init[(R: TRect)];
    function GetPalette: PPalette; virtual;
    procedure Draw; virtual;
    end;

    constructor TMyView.Init[(R: TRect)];
    [var
    R:TRect;]
    begin
    [R.Assign(5, 3, 29, 18);] { Set the window's size }
    inherited Init(R); { BEWARE: R must exist here, either as local variable or a parameter }
    end;

    function TMyView.GetPalette: PPalette;
    begin
    const
    P: string[1] = #19; { This is the color index in the TApplication.Palette }
    begin
    GetPalette := @P;
    end;

    procedure TMyView.Draw;
    begin
    WriteStr(1,1,SomeText,1); { Write the SomeText field to the screen with color index 1 }
    end;

    [/code]
    You can also check out the TVDemo example.

    I don't know how to make a view dragable, but you might want to check the help-file on DragMode and DragView. I think (based on the help-file), that you must write an EventHandler() for the cmResize and cmMove events. These must then call the DrawView() method to do the actual moving or resizing.


  • some1some1 Posts: 19Member
    I don't get it. I still don't understand what turbo vision is. btw the source u gave me won't compile (that's ok coz i don't understand a bit of it)

  • zibadianzibadian Posts: 6,349Member
    : I don't get it. I still don't understand what turbo vision is. btw the source u gave me won't compile (that's ok coz i don't understand a bit of it)
    :
    That code was meant for Netgert and was not a program, but parts of an object inresponse to his question.

    Turbo vision is basically a number of objects, which are used to create a semi-graphical user interface (semi-GUI), such as the intergrated development environment (IDE) of pascal. It consists of a menubar at the top of the screen, a statusbar at the bottom, and a desktop, in which windows and dialog boxes appear.

    Here is the most simple turbo vision program possible:
    [code]
    program MyFirstTV;

    uses App; { I'm not sure about this unit. If this isn't the correct unit, find the unit which has the TApplication type in it. }

    var
    MyApplication: TApplication;
    begin
    MyApplication.Init; { Create the TV application, and initializes its memory }
    MyApplicarion.Run; { Run the application }
    MyApplication.Done; { Destroy the application and free its memory. }
    end.
    [/code]

    This program shows the GUI elements, I described. You can get more help from the "TVISION.HLP" file. (btw this is NOT a windows help-file, but a pascal help-file.

  • some1some1 Posts: 19Member
    : : I don't get it. I still don't understand what turbo vision is. btw the source u gave me won't compile (that's ok coz i don't understand a bit of it)
    : :
    : That code was meant for Netgert and was not a program, but parts of an object inresponse to his question.
    :
    : Turbo vision is basically a number of objects, which are used to create a semi-graphical user interface (semi-GUI), such as the intergrated development environment (IDE) of pascal. It consists of a menubar at the top of the screen, a statusbar at the bottom, and a desktop, in which windows and dialog boxes appear.
    :
    : Here is the most simple turbo vision program possible:
    : [code]
    : program MyFirstTV;
    :
    : uses App; { I'm not sure about this unit. If this isn't the correct unit, find the unit which has the TApplication type in it. }
    :
    : var
    : MyApplication: TApplication;
    : begin
    : MyApplication.Init; { Create the TV application, and initializes its memory }
    : MyApplicarion.Run; { Run the application }
    : MyApplication.Done; { Destroy the application and free its memory. }
    : end.
    : [/code]
    :
    : This program shows the GUI elements, I described. You can get more help from the "TVISION.HLP" file. (btw this is NOT a windows help-file, but a pascal help-file.
    :
    oops, i'm really really sorry, Netgert and zibadian. anyway it won't compile in this line
    MyApplication: TApplication;



  • zibadianzibadian Posts: 6,349Member
    : : : I don't get it. I still don't understand what turbo vision is. btw the source u gave me won't compile (that's ok coz i don't understand a bit of it)
    : : :
    : : That code was meant for Netgert and was not a program, but parts of an object inresponse to his question.
    : :
    : : Turbo vision is basically a number of objects, which are used to create a semi-graphical user interface (semi-GUI), such as the intergrated development environment (IDE) of pascal. It consists of a menubar at the top of the screen, a statusbar at the bottom, and a desktop, in which windows and dialog boxes appear.
    : :
    : : Here is the most simple turbo vision program possible:
    : : [code]
    : : program MyFirstTV;
    : :
    : : uses App; { I'm not sure about this unit. If this isn't the correct unit, find the unit which has the TApplication type in it. }
    : :
    : : var
    : : MyApplication: TApplication;
    : : begin
    : : MyApplication.Init; { Create the TV application, and initializes its memory }
    : : MyApplicarion.Run; { Run the application }
    : : MyApplication.Done; { Destroy the application and free its memory. }
    : : end.
    : : [/code]
    : :
    : : This program shows the GUI elements, I described. You can get more help from the "TVISION.HLP" file. (btw this is NOT a windows help-file, but a pascal help-file.
    : :
    : oops, i'm really really sorry, Netgert and zibadian. anyway it won't compile in this line
    : MyApplication: TApplication;
    :
    What is the error the compiler gives?

  • some1some1 Posts: 19Member

    : What is the error the compiler gives?
    :

    Sorry, i made a mistake. It won't compile on this line
    uses App;

    and i don't know what to do


«1
Sign In or Register to comment.