1 / 35

In The Name Of Allah

In The Name Of Allah. Lab 02. Objectives. • Revision . • Introduction to a GUI. • Starting a Simple GUI Project. Quick Revision. • The Whole program written with small letters Except Variables starting in capital letter. • Each statement end with . Full stop except in Run statements.

fayre
Download Presentation

In The Name Of Allah

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. In The Name Of Allah Lab 02 Tahani aldweesh

  2. Objectives • Revision. • Introduction to a GUI. • Starting a Simple GUI Project Tahani aldweesh

  3. Quick Revision • The Whole program written with small letters Except Variables starting in capital letter. • Each statement end with . Full stop except in Run statements. • With each run():- statement there is fail. • End your program with • _=stdIO::readChar(). • In declaration of facts and predicates : • nameFacts: (arguments dataType). • namePrdicates : (arguments dataType). Tahani aldweesh

  4. Where I Put My Code Tahani aldweesh

  5. Introduction to a GUII A GUI is simply an acronym for Graphical User Interface. • In the Windows operating system environment the term represents the familiar windows: Tahani aldweesh

  6. GUI In Programming Terms • GUI does two things : • It uses complex graphical routines to put graphical images on the relevant parts of the computer monitor. • It also controls the behavior of the mouse and other input devices over these graphical areas. Tahani aldweesh

  7. Both these detailed programming are done by the operating system which provide API (Application Programming Interface ) which can be used to setup the GUI required for any program . Tahani aldweesh

  8. Difference between Console & GUI But on the other hand, the programmer needs to know how each of the GUI components works Tahani aldweesh

  9. Responding to Events In a GUI program, all the GUI components wait for inputs from the keyboard and/or mouse. • The information from such input devices is known as an event. • And for each event there is a listener. Tahani aldweesh

  10. Simple GUI Project • Just contain the Main Menu, ToolBar component. Tahani aldweesh

  11. Starting a GUI Project Tahani aldweesh

  12. When you start Visual Prolog, what is really started is the Integrated Development Environment Tahani aldweesh

  13. The IDE shows the usual parts of a Windows program., They are: • The Task Window. In the IDE the Task Window is the window that is shown when you start a program. You could also call it the “Main Window”. This window usually shows the menu options “File, Edit, View, ..., Windows, Help” on top. • The Task Menu. It is the menu that will be familiar to you as it contains options like “File”,“Edit”, and the other well-known Windows menu options. This menu will also be referred to as “Main Menu”. • The Task Menu Bar. It contains icons for the most used options in the Task Menu. • The Project Overview. It lists the names of the projects that have been processed in the IDE. • The Message Window. This window is typical for Visual Prolog and the IDE. Tahani aldweesh

  14. 1- Creating a project Step 1. Create a new project Tahani aldweesh

  15. Tahani aldweesh

  16. The first field Project Name :will contain the project name. • The next field is the UI Strategy. It indicates what kind of user interface you will use. Tahani aldweesh

  17. Project tree Project Tree The Project Tree is also called the Project Directory. It shows the set of folders and modules in which the IDE keeps track of your program. The root name of the Project Tree is “same name of your project". Tahani aldweesh

  18. “.pack“: This file contains the basic information about your project Tahani aldweesh

  19. step 2: Build, compile and execute the program Tahani aldweesh

  20. Execution of program (GUI Project Components) Main menu Tool bar Task window Status bar Tahani aldweesh

  21. Generate prolog code To generate the Prolog code, choose the option Build/Build from the Task Menu Watching the messages in the Message Window gives you an idea of how much code is necessary to create an simple Windows program .The IDE has added among others the file “same name of your project.pro”. This is the file where you will find the kernel Prolog code of your program.. The other files also contain Prolog code. To see what is inside, simply double click on the name, but please don’t change the code Tahani aldweesh

  22. 2. Create a form Tahani aldweesh

  23. Select (form) From list From this list, Select item what you want to create Tahani aldweesh

  24. The window titled “Layout” is also a toolbar. The icons represent different ways to adjust the layout of the controls on the form. The window titled “Controls” is in fact a toolbar. It shows icons for every control that can be put on the form. Tahani aldweesh

  25. The window titled “form2" is the form edit window. It is a prototype in which already three controls are put by the IDE. Tahani aldweesh

  26. contains the properties of the selected item on the form. When there is no item selected, the properties of the form are shown. When you don’t see the properties of the form, click anywhere in the form and the properties will look .. Tahani aldweesh

  27. When you now look at the project tree, you see that there is a file added, named “form2.frm”. When you click Build/Build you will see that some files are added to the project tree. They are: “form2.cl”, “form2.i”and “form2.pro”. These files contain the necessary Prolog code and it is the place where you will put your own code. You may want to open the file “form2.pro” to see the code the IDE has generated Tahani aldweesh

  28. Note: you certainly took notice of the fact that the File/New option was disabled. It was grey, that means in Windows that the option cannot be used. If we want to use it, it must be enabled. To find the place to enable File/New, go to the Project Tree. In the Project Tree you see a folder icon labeled “Taskwindow”. This folder contains everything that is needed to create the Task Window (or Main Window) when you start the program. Please open the folder TaskWindow. Tahani aldweesh

  29. 3- Modifying the Main Menu(TaskMenu.mnu) • To Modify the menu : • right click on the TaskMenu.mnu item as seen: Tahani aldweesh

  30. Tahani aldweesh

  31. • Test the menu Click on T : Tahani aldweesh

  32. The menu option File/New isenabled now. When you run theprogram you will see that it is nolonger grayed. But when you clickon it, nothing happens. That isbcause we have not yet addedcode to the menu option. Now isthe time to add the necessaryProlog code to this option. To addcode to the File/New option, goback to the project tree and lookfor the file “TaskWindow.win”. Inthis file you manage and controlthe Prolog code that is linked tothe various parts of the TaskWindow. Tahani aldweesh

  33. Add code Tahani aldweesh

  34. Any Question Tahani aldweesh

  35. الابتســــامة لغــة لا تحتاج إلى ترجمة ..... Tahani aldweesh

More Related