Discussions related to Visual Prolog
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

Which version?

Do you have an imageControl in your form?
Regards Thomas Linder Puls
PDC
hicham
Active Member
Posts: 29
Joined: 3 Apr 2014 8:32

Unread post by hicham »

yes i do have imagecontrol , the problem i have is in setImageFile
ok
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

Which version of Visual Prolog are you using?
Regards Thomas Linder Puls
PDC
hicham
Active Member
Posts: 29
Joined: 3 Apr 2014 8:32

Unread post by hicham »

7.4
ok
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

The imageControl in 7.4 Commercial Edition does have a setImageFile predicate, so you must be doing something wrong.

Please show us your code (or the relevant part)?
Regards Thomas Linder Puls
PDC
hicham
Active Member
Posts: 29
Joined: 3 Apr 2014 8:32

Unread post by hicham »

i created a form called hicham
i created a control called imageControl in my form

Code: Select all

implement hicham     inherits formWindow     open core, vpiDomains     clauses     display(Parent) = Form :-         Form = new(Parent),         Form:show().   clauses     new(Parent):-         formWindow::new(Parent),         generatedInitialize(),         flipImage(true).             predicates     flipImage : (boolean Image). clauses     flipImage(S) :-         if true=S then             imageControl_ctl:setImageFile(@"..\taskwindow\ProjectIcon.ico")         else             imageControl_ctl:setNoImage()         end if,         delayCall(300, { :- flipImage(boolean::logicalNot(S)) }).
i build the project
ihave this error : undeclared identifier 'setImageFile/1'
ok
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

How does the declaration of imageControl_ctl look?
Regards Thomas Linder Puls
PDC
hicham
Active Member
Posts: 29
Joined: 3 Apr 2014 8:32

Unread post by hicham »

i dont understand the question .. can u show me how imageControl_ctl look ?
ok
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

The declaration of my imageControl_ctl looks like this (last line):

Code: Select all

% This code is maintained automatically, do not update it manually. 11:50:14-24.4.2014 facts     ok_ctl : button.     cancel_ctl : button.     help_ctl : button.     imageControl_ctl : imagecontrol.
Regards Thomas Linder Puls
PDC
hicham
Active Member
Posts: 29
Joined: 3 Apr 2014 8:32

Unread post by hicham »

this is what look like mine too
ok
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

Strange.

My imageControl.i looks like this:

Code: Select all

/*****************************************************************************                           Copyright (c) Prolog Development Center A/S   @short Image control is the control to draw images of various graphic formats.   @detail The set of supported graphic formats corresponds to the set of formats, supported by GDI+. @end @control ******************************************************************************/   interface imageControl     supports control     open core   predicates from drawControlSupport     getBorder, setBorder   predicates     setImageFile : (string FileName).     % @short Loads the control image from the specified file.     % @detail Note that the specified file is loaded only when the control is show.     % @end   predicates     getImageFile : () -> string FileName.     % @short Returns the #FileName previously set by setImageFile predicate.     % @exception imageControl_exception::imageFileNotSet_exception is raised if no image file is set.     % @end   ...
setImageFile is almost at the top. Does your file look the same?
Regards Thomas Linder Puls
PDC
hicham
Active Member
Posts: 29
Joined: 3 Apr 2014 8:32

Unread post by hicham »

No , do i need to add theses predicates or they already exist? .. because mine is empty
ok
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

The file exists already and should look like the one I have shown, it is in $(ProDir)\gui\controls\imagecontrol.

(It is only in the Commercial Edition, but you said you have the Commercial Edition).
Regards Thomas Linder Puls
PDC
hicham
Active Member
Posts: 29
Joined: 3 Apr 2014 8:32

Unread post by hicham »

i think i was wrong , sorry .. i dont have commercial edition ... so now what should i do ? add these predicates ???
ok
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

You would need to add not only such predicates, but also everything else needed to impelment an imageControl.

There are differences between the Commercial and Personal Editions, you have now discovered one of them.
Regards Thomas Linder Puls
PDC
Post Reply