Search found 119 matches

by Steve Lympany
29 Aug 2011 22:35
Forum: Visual Prolog
Topic: Functor of an internal database
Replies: 3
Views: 1450

Hi,
It could be because you have
a) "syn" -vs - "syntax"
or
b) "Clauses" instead of "clauses"

maybe?
regards
steve
by Steve Lympany
9 Aug 2011 12:48
Forum: Visual Prolog
Topic: How to use the checkbox of VIP?
Replies: 9
Views: 4222

Hi, It seems like your terminology/ideas are a bit mixed up! Have you been through any tutorials? The listbox control contains a list of strings, so a,b etc are strings. You have f as a horn clause,but you want to make it "appear" in a dialog box. I'm a bit lost on that! f is a predicate,not a contr...
by Steve Lympany
13 Jul 2011 8:49
Forum: Visual Prolog
Topic: Working with jpg files
Replies: 12
Views: 5222

Hi Paul,
Yes, I've tried that, and didn't get very far (after several hours). Hence the above idea,just to change the size.

Many thanks for the ideas. I'll continue to play and will post a solution if I am successful.

cheers
steve
by Steve Lympany
12 Jul 2011 7:25
Forum: Visual Prolog
Topic: Working with jpg files
Replies: 12
Views: 5222

Hi Paul, I haven't tried. I want to open a jpg and use vpi::picture (which only reads a bmp). The following works: predicates jpgToBmp :(string JpgFile). clauses jpgToBmp(JpgFile):- Image=image::createFromFile(JpgFile),%or bitmap:: gdiplus::imageCodecInfo(BMPId, _, _, _, _, _, _, _, _, _, _, _, _) =...
by Steve Lympany
11 Jul 2011 14:31
Forum: Visual Prolog
Topic: Working with jpg files
Replies: 12
Views: 5222

Hello again, Still fiddling around with this. The following code is supposed to convert a jpg to a bitmap. The reason I do it this way is that if I do it without any sizing, a 6Mb JPG converts to a 200Mb BMP. Unfortunately, the code below only produces a black bitmap. Any ideas? predicates jpgToBmp ...
by Steve Lympany
29 Jun 2011 18:05
Forum: Visual Prolog
Topic: Working with jpg files
Replies: 12
Views: 5222

Hi,
Many thanks for your thoughts.
Tonton, I assume you mean grab the picture from a window/form/screen....? It's an idea, but I think I (end-users) will lose resolution.

cheers
Steve
by Steve Lympany
27 Jun 2011 18:42
Forum: Visual Prolog
Topic: Working with jpg files
Replies: 12
Views: 5222

Hi Tonton,
Thanks, yes, I saw those, but they don't really help. I want to work with a vpi::picture, but load a jpg.

cheers
steve
by Steve Lympany
27 Jun 2011 9:33
Forum: Visual Prolog
Topic: Working with jpg files
Replies: 12
Views: 5222

Working with jpg files

Hi, Is there a better way of doing the following, eg using iStream_native, rather than working on disk? predicates jpeg_picture:(string JpegFile)->picture. clauses jpeg_picture(JPG)=Picture:- Workfile="C:\\a.bmp", Bitmap=bitmap::createFromFile(JPG), gdiplus::imageCodecInfo(JpegId, _, _, _, _, _, _, ...
by Steve Lympany
15 Jun 2011 12:27
Forum: Visual Prolog
Topic: I am Asking for simple complete Example for a Digital clock .
Replies: 13
Views: 3643

Hi, I'm sure Tonton's code above will work in VIP7.2 clauses onShow(_Source, _Data):- _ = timerSet(1000). It is in class vpi:: Can you not see it there? i.e _ = vpi::timerSet(1000) And add the timerListener with the IDE for the form. That's all that's needed. cheers Steve
by Steve Lympany
10 Jun 2011 11:04
Forum: Visual Prolog
Topic: I am Asking for simple complete Example for a Digital clock .
Replies: 13
Views: 3643

Hi Tonton, You set the timer to be called every second, so the listener will be called every second. The timer is created in the onshow(). I haven't checked, and I am not 100% sure whether the timer is killed when the dialog/form is destroyed. So it might be a good idea to destroy the timer (via a t...
by Steve Lympany
9 Jun 2011 21:55
Forum: Visual Prolog
Topic: I am Asking for simple complete Example for a Digital clock .
Replies: 13
Views: 3643

Hi Tonton,
May I simplify that a little please?

Code: Select all

predicates     onTimer : window::timerListener. clauses     onTimer(_Source, _TimerId):-         my_digital_text:settext(timeFormatter::new():format(gmttime::new(),"HH:mm:ss")),         .
cheers
steve
by Steve Lympany
9 Jun 2011 21:44
Forum: Visual Prolog
Topic: I am Asking for simple complete Example for a Digital clock .
Replies: 13
Views: 3643

...and if you want it updated every second, add a timer (timerset), and the ontimer listener

cheers
steve
by Steve Lympany
6 Jun 2011 10:35
Forum: Visual Prolog
Topic: Keydown event for arrows keys
Replies: 12
Views: 5281

Hi, Yes, it would be good to have onchar working again. On a related topic / problem, with my drawwindow I get a Windows "bong" when I press a key. I traced it back to the "backtrack point" call of vpiInit() (if that's the right expression). It bongs even when the keyup is recognised. How can I supp...
by Steve Lympany
21 Mar 2011 8:26
Forum: Visual Prolog
Topic: how to insert images on a form?
Replies: 32
Views: 8545

Hi, In your form: predicates onPaint : drawWindow::paintResponder. clauses onPaint(_Source, _Rectangle, GDI):- Pic=get_your_picture(), GDI:pictdraw(Pic,pnt(0,0),rop_SrcCopy), The onPaint is called when the form is invalidate() ed. The onPaint predicate "skeleton" is inserted by the IDE - have you fo...
by Steve Lympany
16 Mar 2011 8:30
Forum: Visual Prolog
Topic: how to insert images on a form?
Replies: 32
Views: 8545

Hi,
http://wiki.visual-prolog.com/index.php?title=Main_Page

See Visual Prolog for Tyros, chapter 8

cheers
Steve