View previous topic :: View next topic |
Author |
Message |
Martin_K
Joined: 09 Apr 2020 Posts: 227
|
Posted: Sat Feb 06, 2021 10:10 pm Post subject: ClearWin+ Visual |
|
|
Hello to everybody!
I am back after more than 6 months of non-programming (we were busy with integrating different type of sensors like echo sounders, GNSS receiver, velocity sensors, ... on a measuring boat for bathymetry purposes).
Now, I need to create a quite simple program for a basic data presentation
coming from mobile mapping. I decided to use the "Visual" feature of ClearWin+. And at the very beginning I am stuck with a specific problem relating to slovakian punctuation (like accents and wedges).
Here is the beginning of the main program to access the design mode:
Code: |
winapp
program mob_map_info
use clrwin
implicit none
integer iw
iw = winio@('%~wi',100)
!
! umoznenie pisania diakritiky v texte
!
! call ENABLE_UTF8@(1)
! iw=winio@('%ww[thin_border]&')
! iw=winio@('%ca[Inform�cie z mobiln�ho mapovania � AGIS Slovakia, spol. s r. o., www.agis.sk]')
end program mob_map_info
resources
1 layout "Mob_Map_Info.rcx"
|
When I do not use the call to ENABLE_UTF8@(1) (to enable correct punctuation), the result of design mode when inserting there a text string is OK, see picture below:
[url]
Then, I removed the comments in the program above along with the tilde sign (~) in front of %wi to include a caption
to the designed window, since the caption contains some special characters. I included the call to the function ENABLE_UTF8@(1) as follows
and the build the executable:
Code: |
winapp
program mob_map_info
use clrwin
implicit none
integer iw
iw = winio@('%wi&',100)
!
! umoznenie pisania diakritiky v texte
!
call ENABLE_UTF8@(1)
iw=winio@('%ww[thin_border]&')
iw=winio@('%ca[Inform�cie z mobiln�ho mapovania � AGIS Slovakia, spol. s r. o., www.agis.sk]')
end program mob_map_info
resources
1 layout "Mob_Map_Info.rcx"
|
After running the program, the result can be seen here:
[url]
As can be seen in the picture above, some special characters in the caption are not displayed correctly (the red underlined part of text).
So, I moved the call to ENABLE_UTF8@(1) in front of %wi format code
and the effect can be seen below:
[url]
This time, the text in caption is OK, but some special characters in design
window (red underlined) are corrupted.
Finally, I have a very strange problem. When I use the USE CLRWIN or USE MSWIN command, compiler reports me constantly the following:
When I build the program, everything is OK (no compiler errors) and the program runs.
Any idea where am i doing some mistake(s)?
Thanks in advance for your valuable advises!
Martin |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7938 Location: Salford, UK
|
Posted: Sat Feb 06, 2021 10:32 pm Post subject: |
|
|
Martin
The FTN95 error report can be ignored. It is because FTN95 can't see the module when when doing the interactive compiling. You could switch off the feature from the Settings dialog on the Tools menu.
Can you zip up the program and resource file and put the zip file on Dropbox or somewhere like that. Then I can work out what is going wrong with the UTF8 characters |
|
Back to top |
|
|
Martin_K
Joined: 09 Apr 2020 Posts: 227
|
|
Back to top |
|
|
Martin_K
Joined: 09 Apr 2020 Posts: 227
|
Posted: Sun Feb 07, 2021 6:37 pm Post subject: |
|
|
Paul,
still one question. Where should be placed the resource files (BMP, ICO, JPG, ...). I defined full path (after RESOURCES directive after the end statement) where they reside on my PC and I get the error message in the design mode, when I try to insert a picture/image/icon: NO IMAGE RESOURCES OF THIS TYPE FOUND.
Note: In the PLATO�s Project/Properties/Miscellaneous the option SRC compiler is unchecked. Which parameters should I specify there?
Thanks
Martin |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7938 Location: Salford, UK
|
Posted: Tue Feb 09, 2021 1:16 pm Post subject: |
|
|
Martin
The designer does not work with UTF8 characters. I will make a note that this feature needs to be added.
You can use the full path for an image but the resource compiler requires a double backslash as in
Code: | myicon ICON "\\techsupport\\wmdm.ico"
|
When designing,
1) Right click and select "New Picture" etc.
2) Select the image with Ctrl+click (the cursor changes to a hand).
3) Right click and select Properties.
4) Find and select "myicon" from the list. |
|
Back to top |
|
|
Martin_K
Joined: 09 Apr 2020 Posts: 227
|
Posted: Tue Feb 09, 2021 2:27 pm Post subject: |
|
|
Thanks Paul for the information!
It will look a little bit strange to have there (when using designer)
the text or buttons with slovak text without accents and wedges.
Although I can program it from scratch classically, where no problem
with UTF8 characters occurs, I feel that the designer
(when improved) will be a great tool to speed up and make designing of
the windows more straightforward.
I look forward to the new release where this feature will be implemented.
Thanks again!
Still back to the RESOURCES directive.
My code looks like follows:
Code: |
...
...
end program mob_map
resources
agis BITMAP agis.bmp
agis ICON agis.ico
agis IMAGE agis.jpg
|
All three files are in the same place on the PC as source code (in a Project folder).
It does not work (the same error message as stated in my previous post).
In the online help for RESOURCES IN FTN95 is written that:
In order to use the RESOURCES directive, the SRC command must be available on the PATH. All the resources for a program must be supplied in one place.
I had a look at the FVARS.bat file and it originally looked like this:
SET PATH=C:\Windows\Microsoft.NET\Framework\v2.0.50727\;%PATH%
SET F95INCLUDE=D:\Program Files (x86)\Silverfrost\FTN95\Include
SET MOD_PATH=D:\Program Files (x86)\Silverfrost\FTN95\Include
To be sure, I also manually added the 4th line
to the FVARS.BAT where src.exe resides as follows:
SET PATH=D:\Program Files (x86)\Silverfrost\FTN95\
Still have the same error message. Where is the problem?
(all three images - ICO/BMP/JPG were created in Adobe package
and after their creating I put all three files to the project folder, where source code resides).
Thanks for help!
Martin |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7938 Location: Salford, UK
|
Posted: Tue Feb 09, 2021 3:49 pm Post subject: |
|
|
Martin
Each image must have its own identifier as in...
Code: | end program mob_map
resources
agis1 BITMAP agis.bmp
agis2 ICON agis.ico
agis3 IMAGE agis.jpg |
|
|
Back to top |
|
|
Martin_K
Joined: 09 Apr 2020 Posts: 227
|
Posted: Tue Feb 09, 2021 11:40 pm Post subject: |
|
|
Thanks Paul!
I tried it - but it simply does not work, always the same ClearWin+ error message reported earlier although the compiler creates the file called SRCTEMP@.RC which contains exactly the same
instructions like in the RESOURCES command.
I have no idea where is the problem, so I will use the %BM instead designer since I need some graphics in the empty area between the text and three yellow buttons (see picture below):
Here are a few remarks for your consideration when you will improve the designer:
1. It would be great to include in the designer the UNDO and REDO button - it will help greatly.
2. I included the call to ENABLE_UTF8@(1) in my call-back for the middle yellow button (see picture above) and it works with no distortion when I press the button as can be seen below:
3. I observed an interesting thing: when I run the program in the design mode (with tilde in front of %WI) using the external call back with UTF8 enabled, the three yellow button are CLEARLY yellow (see picture below):
When I remove the tilde and create the exe, the three buttons change
slightly their color (see first picture) and their bottom half is slightly greyed out.
4. It would be great to include for every item in the designer a brief interactive help.
Now, I am going to activate (write a call back) for the third button for the graphics using the %PL and your excellent PARAMS and LOCKED options.
I also have some additional suggestions for the %PL enhancement, but I will discuss it later, after the graphics button will work with my field data
as I want.
BTW - If you would have an additional idea, why JPG/BMP/ICO pictures do not work in the designer with me, I would be very thankful to you. To be honest, it annoys me, since I am great fan of your designer and see in it great potential (there would be no need for the 3rd party add-ons like Winteracter)!
Thanks again! |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2834 Location: South Pole, Antarctica
|
Posted: Wed Feb 10, 2021 5:47 am Post subject: |
|
|
Martin
Next time please use Dropbox or OneDrive. Your link started other link with some video running in the browser without user consent. Same way owners of content may start any virus as the site owners seems don't care. Could be a ones per 10 years coincidence, but then all my windows went crazy dancing abruptly getting full windows size, virus scan did not finish properly, and i was forced to close all my work, download virus updates, scan again and reboot. I think policy of this site has to forbid any hosting sites besides major ones
Last edited by DanRRight on Wed Feb 10, 2021 8:58 am; edited 1 time in total |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7938 Location: Salford, UK
|
Posted: Wed Feb 10, 2021 8:27 am Post subject: |
|
|
Martin
Adding images is demonstrated in the Youtube video...
https://www.youtube.com/watch?v=JnhX4uV92Pg&t=1s
24 minutes from the start.
This still works for me. The only difference is that a refresh is no longer needed. The images appear automatically after closing the Properties dialog.
The call to ENABLE_UTF8@(1) should be placed in the main program before the first call to winio@. |
|
Back to top |
|
|
Martin_K
Joined: 09 Apr 2020 Posts: 227
|
Posted: Thu Feb 11, 2021 12:28 pm Post subject: |
|
|
Paul,
I watched your video several times before I put this topic.
I did all exactly as demonstrated in your video with no success
(except standard icons, they work).
So, brief summary:
It is for release:
Now, my resource looks like this:
And when I am in the designer and want to put the image there, get the
following after pressing PROPERTIES (for me - for unknown reasons):
Since it did not work for me, I used %IM and loaded the required image
from an external file.
Originally - I put the CALL ENABLE_UTF8@(1) in the main program, it
did not work correctly, since it either distorted the UTF8 characters in the text of the designer or in the caption (depending where the call was placed in the main program). You also stated that UTF8 characters do not
work with the designer.
Therefore I put the call to a call-back and it works.
Best wishes!
Martin |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7938 Location: Salford, UK
|
Posted: Thu Feb 11, 2021 1:32 pm Post subject: |
|
|
Martin
Which version of FTN95 are you using and what is the date of your salflibc.dll or clearwin64.dll?
I have extended the designer so that it will work when ENABLE_UTF8@(1) is called at the start of the main program. The new version will allow you to enter UNICODE strings in the Properties dialog for text and for buttons (including radio, check and group buttons). In my testing I have used Google translate to enter a phrase in English, translate it to Russian, copy to the clipboard and finally paste into the edit box of the Properties dialog.
I still can't get a failure when using images. Maybe you need later versions of the DLLs. |
|
Back to top |
|
|
Martin_K
Joined: 09 Apr 2020 Posts: 227
|
Posted: Thu Feb 11, 2021 2:03 pm Post subject: |
|
|
Thanks Paul!
Here is the required info:
I am using FTN95 PE v8.70
Clearwin:
SALFLIB:
Martin |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7938 Location: Salford, UK
|
Posted: Thu Feb 11, 2021 8:04 pm Post subject: |
|
|
Martin
1) The call to ENABLE_UTF8@(1) should be made at the beginning of the main program, before any calls to winio@. It makes no logical sense to call it in a winio@ callback function. You can set this flag and it will make no visible difference to the display for code that does not use UTF8 characters. In other words, ASCII is a subset of UTF8.
2) Microsoft edit boxes (that are used by ClearWin+) can receive UNICODE character strings. For these edit boxes, ClearWin+ converts from UTF8 to UNICODE for input and from UNICODE to UTF8 for output.
3) Visual ClearWin+ can be used to design dialogs using ASCII text. Then the resulting rcx file can be manually edited to change the ASCII text to UTF8 characters. An editor like Plato can be used to input UTF8 characters but you must use the enhanced Save options when saving the file. Plato also uses UNICODE internally and converts on saving. |
|
Back to top |
|
|
|