Search found 591 matches

by akj
Mon Nov 18, 2024 1:07 pm
Forum: Coding Questions
Topic: Problem with EventType() function
Replies: 5
Views: 966

Re: Problem with EventType() function

Hi mk-soft,

Thank you for your SetGadgetCallback module which I will have a good look at.

I'm surprised the code is so lengthy for such a basic facility.

akj
by akj
Sun Nov 17, 2024 8:12 pm
Forum: Coding Questions
Topic: Problem with EventType() function
Replies: 5
Views: 966

Problem with EventType() function

I have recently returned to writing PB code after a break of 6 years, so I am now very forgetful of coding details, but have managed to satisfactorily complete a couple of test/exercise programs.
My third test program will focus on binding events to windows and gadgets. But I have hit a problem with ...
by akj
Thu Nov 15, 2018 4:54 am
Forum: General Discussion
Topic: IDE 'Issues' fails to detect the string "!!!"
Replies: 2
Views: 1540

Re: IDE 'Issues' fails to detect the string "!!!"

Hi Demivec. Thanks for your suggestions.
In the end I decided to use the very simple regular expression !!! to match the !!! text
It seems to work quite well.
by akj
Thu Nov 15, 2018 2:40 am
Forum: General Discussion
Topic: IDE 'Issues' fails to detect the string "!!!"
Replies: 2
Views: 1540

IDE 'Issues' fails to detect the string "!!!"

I'm trying to use the IDE Editor Preferences for issues, such as "TODO" and "FIXME" for a new issue "!!!".
I have tried various regular expressions to match !!! such as \b!!!\b.* and \b\!\!\!\b.* and \b\x21\x21\x21\b.* but none of them work.
What will work?

P.S. In the Preference window for Issues ...
by akj
Wed Oct 31, 2018 8:10 pm
Forum: Coding Questions
Topic: GetGadgetAttribute(#canvas, #PB_Canvas_Imag
Replies: 2
Views: 1596

Re: GetGadgetAttribute(#canvas, #PB_Canvas_Imag

Thank you Rashad for your very helpful answer, which works.
by akj
Tue Oct 30, 2018 4:59 pm
Forum: Coding Questions
Topic: GetGadgetAttribute(#canvas, #PB_Canvas_Imag
Replies: 2
Views: 1596

GetGadgetAttribute(#canvas, #PB_Canvas_Imag

I wish to take the image from a canvas gadget, crop it, save it as a separate image and eventually print it.
My code [within a much longer program] is something like this:
#canvas = 1
StartDrawing(PrinterOutput())
imageID = GetGadgetAttribute(#canvas, #PB_Canvas_Image) ; #canvas is the gadget ...
by akj
Tue Oct 06, 2015 11:11 pm
Forum: Coding Questions
Topic: Why won't the PB executable run?
Replies: 13
Views: 3610

Re: Why won't the PB executable run?

Thanks for all your help.

The solution I have adopted was mentioned by wilbert who advised me to send the .exe file via http://www.WeTransfer.com .
by akj
Sat Oct 03, 2015 10:22 am
Forum: Coding Questions
Topic: Why won't the PB executable run?
Replies: 13
Views: 3610

Re: Why won't the PB executable run?

Thank you for your suggestions, but the problem is still unresolved.

Some details: My brother's email browser is Live Mail within Internet Explorer 10 with Avast anti-virus (I'm using Kaspersky anti-virus on my PC). I understand he is not using Endpoint Protection.

I successfully zipped my .exe ...
by akj
Fri Oct 02, 2015 9:33 pm
Forum: Coding Questions
Topic: Decimal numbers problem
Replies: 28
Views: 4994

Re: Decimal numbers problem

In my opinion Debug 1.4+1.4 resulting in 2.7999999999999998 rather than 2.8 is not a problem, as a properly-coded program will always specify the number of decimal places to be given in the output so that it looks neat in the GUI (or other) display.
So, instead of coding 1.4+1.4, the final version ...
by akj
Fri Oct 02, 2015 8:26 pm
Forum: Coding Questions
Topic: Why won't the PB executable run?
Replies: 13
Views: 3610

Why won't the PB executable run?

When I email a PB compiled executable (either 32-bit or 64-bit) to my brother [and to others] and he tries to run it under 64-bit Windows 7 Ultimate he always gets the error message "Your internet security settings prevented one or more files from being opened". This is true even if:-
1. I rename ...
by akj
Wed Sep 09, 2015 3:25 am
Forum: Coding Questions
Topic: Debugging Shared Variables
Replies: 0
Views: 1045

Debugging Shared Variables

How do I display the values of shared variables in the Variable Viewer window whilst debugging? They are not shown by default.

[Shared variables are those declared by the keyword 'Defined' in the Main scope AND declared by the keyword 'Shared' in selected procedures]
by akj
Mon Sep 07, 2015 2:05 pm
Forum: Coding Questions
Topic: Need help with DrawVectorText()
Replies: 4
Views: 1865

Re: Need help with DrawVectorText()

Thank you User_Russian for your working code.

However, I have a query:
Why does

Code: Select all

VectorFont(FontID(0), 20)
result in a different text size from

Code: Select all

VectorFont(FontID(0))
even though the default text height is 20 as set by

Code: Select all

LoadFont(0, "Arial", 20)
?
by akj
Mon Sep 07, 2015 1:26 pm
Forum: Coding Questions
Topic: Need help with DrawVectorText()
Replies: 4
Views: 1865

Need help with DrawVectorText()

; DrawVectorText() failure
EnableExplicit
Enumeration
#win
#cnv
EndEnumeration
OpenWindow(#win, 0, 0, 638, 560, "Test", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
CanvasGadget(#cnv, 418, 162, 60, 60)
StartVectorDrawing(CanvasVectorOutput(#cnv))
DrawVectorText("Hi")
StopVectorDrawing ...
by akj
Wed Jun 04, 2014 3:37 pm
Forum: Coding Questions
Topic: I have an Issue with Issues
Replies: 6
Views: 1869

Re: I have an Issue with Issues

Thank you Demivec
by akj
Wed Jun 04, 2014 2:58 pm
Forum: Coding Questions
Topic: I have an Issue with Issues
Replies: 6
Views: 1869

I have an Issue with Issues

Ever since I started using PureBasic (June 2003) I have been using !!! (three consecutive exclamation marks) within comments to flag issues requiring my attention.
In File -> Preferences -> Editor -> Issues I have tried to create a new issue marker to reflect this, but regular expressions of \b!!!\b ...