Recent Posts

Pages: [1] 2 3 ... 10
1
Development Progress / September 2020
« Last post by Malkom on Today at 01:46:54 PM »
Here is a brief progress report on HN5 development for the month of September 2020.

The aim is to get the Chart demo project running inside HN5 Creator IDE.

The development is being carried out on a Windows 7 x64 machine with regular testing of HN5 on Linux(Lubuntu).

The development language is Free Pascal which should ensure HN5 will be able to run on a variety of Operating Systems, both newer and older versions. The main targets being Windows, OS X and Linux.


RUNTIME ENGINE

Most of the keywords and functions needed by the Chart project are now implemented.
Those remaining are mostly concerned with the GUI such as canvas, color picker etc.


HELP SYSTEM

This now loads and correctly displays a test HAC help file.
It uses self-contained Free Pascal code to ensure that it will be both cross-platform and not need external helper apps.

 

 

2
Getting Started / Re: How can I use Listbox?
« Last post by Malkom on September 27, 2020, 09:55:24 AM »
In these examples the listbox has the ID 1, and has 3 columns and 10 rows.

Before starting with a listbox its usually best to reset it because HN can remember the final structure from when the project was previously run in Creator.

Code: [Select]
ListboxDeleteAll(1)

A listbox can also be set up in the card's opening event so making it appear instantly.
When editing a card's script or its controls:
   The opening event is the first item in the leftmost column of the listbox entitled "Card".
   Any items listed after the card's opening event are all for for controls such as buttons fields etc,

Set a listbox to have 3 columns:
Code: [Select]
ListboxSetColumns(1,3)

Alternatively you could build a 3 column listbox having 10 rows using the ListboxBuild command:
Code: [Select]
ListboxBuild(1,10,3)




  • How can I set heading text?

Code: [Select]
ListboxSetHeading(1,1,'Title 1')
ListboxSetHeading(1,2,'Title 2')
ListboxSetHeading(1,3,'Title 3')



  • How can I Insert a value into the second column?

So to set the listbox cell column 2 and row 9, to value 'hello' use:
Code: [Select]
ListboxSetCellValue(1,9,2,'hello')



  • Can I run a command If the user double clicks on a row?

Your script can check for various listbox events using the function ListboxEventFN(id):

For instance, this code checks if a cell was clicked. When a cell is clicked, it finds the cell coordinates and then calls a user-defined procedure to do something.
Code: [Select]
Local event,row,col

Put ListboxEventFN into event
If event=2 then
    Put ListboxRowClickedFN(1) into row
    Put ListboxColumnClickedFN(1) into col   
    Put ListboxCellValueFN(1,row,col) into txt
    Call DoSomething(row,col,txt)
endif

Note, a listbox's script is only called in response to an event such as when the user clicks a cell, drops a file on it, etc.

Here are the event numbers and descriptions:
         1 - Cell action either editable cell or checkbox clicked.
         2 - Cell clicked.
         3 - Drag reorded rows.
         4 - Drag row.
         5 - Drop drag.
         6 - Drop file.
         7 - Double click.
         8 - Header pressed
         9 - Cell key down.
         10 - Cell got focus.
         11 - Cell text change.
         12 - Cell lost focus.
         13 - Sort column.




  • How to add more columns

The ListboxSetColumns(id,ncols) changes the number of columns, for instance to 5, in this code:
Code: [Select]
ListboxSetColumns(1,5)

Note, if you want to add a row use the ListboxAddRow(id,value) command.
It adds value into the first cell of the new row.
Code: [Select]
ListboxAddRow(1,'cell value')
3
Getting Started / Re: How can I use Listbox?
« Last post by Malkom on September 27, 2020, 08:54:39 AM »
I try reading "Language Reference 401.pdf" on the download page.
Now I know how to add a value into the second column by using the "ListboxSetCellValue bid, row, col, val" command
  • bid: Field ID
  • row: What row you want to insert a value
  • col: What column you want to insert a value
  • val: Message you want to be insert

Set Heading text by using the "ListboxSetHeading bid, col, val"
  • bid: Field ID
  • col: Column you want to set the heading
  • val: Text you want to set

Get the currently selected row by using the "ListboxIndexFN(1)" command
usage: Put ListboxIndexFN(1) into num

That's all I know for Today.

Thank you for partially answering your own questions and so helping others :)

I'll add some example code in the post below.



4
Getting Started / Re: How can I use Listbox?
« Last post by LinesOfCodes on September 27, 2020, 01:56:30 AM »
I try reading "Language Reference 401.pdf" on the download page.
Now I know how to add a value into the second column by using the "ListboxSetCellValue bid, row, col, val" command
  • bid: Field ID
  • row: What row you want to insert a value
  • col: What column you want to insert a value
  • val: Message you want to be insert

Set Heading text by using the "ListboxSetHeading bid, col, val"
  • bid: Field ID
  • col: Column you want to set the heading
  • val: Text you want to set

Get the currently selected row by using the "ListboxIndexFN(1)" command
usage: Put ListboxIndexFN(1) into num

That's all I know for Today.
5
Getting Started / How can I use Listbox?
« Last post by LinesOfCodes on September 26, 2020, 05:44:21 AM »
I want to use a Listbox but I don't know what command I have to type to use it the way I want.
I want to know:
  • How can I set heading text?
  • How can I Insert a value into the second column?
  • Can I run a command If the user double clicks on a row?
  • If HyperNext can't do the third one, then Can HyperNext script get the number of the row in the list that the user is selected?
  • How to add more columns

That's all I want to know.
6
General / Re: Documentation Improvement
« Last post by Malkom on September 21, 2020, 06:50:50 AM »
Hey, Developer.
Can you improve the HyperNext 4 Documentation? (Guide > Overview)
Because in HN4 Docs. It didn't explain everything. Such as didn't tell the meaning of parameters, Example of command usage, etc.
I know now, you're focusing on developing HN5 and will never add more features into this HN4 but please improve the documentation.

Thank you for your post as it has really helped clarify things.

A big problem with updating the inbuilt HN4 guide is that its made using a text to binary parser that is quite primitive, has bugs, and is tedious to use. I wrote it nearly 20 years and never got around to fixing it.

I'll do my best to answer any questions posted here. Topics here help other HN users and they'll probably make their way into the HN5 help.

Please feel free to ask any questions, although often any code I'll provide will only be brief snippets.


HN5 Help

The HN5 help is based on that in HAC(HyperNext Android Creator). HAC's was much better than HN4 as it was friendlier, using a CHM file that supported links and images, and had a better index. However, HAC used the external MS Windows CHM viewer utility.

HN5's inbuilt help system can already load the HAC help CHM file, display it, and is searchable. It works cross-platform as it use Free Pascal code.

The process of converting HN4 help text into a CHM file for HN5 is now underway.  lt is being updated, and improved with suggestions from previous posts here, and will available for download as help for HN users.

By the way, it looks easy to add some new HN commands so users can display their own CHM help files etc in HN5.


Note, I'm using a HelpNDoc to create the CHM and PDF files. They is also have fully functional free version available (for non commercial use only).


7
General / Documentation Improvement
« Last post by LinesOfCodes on September 19, 2020, 06:45:57 AM »
Hey, Developer.
Can you improve the HyperNext 4 Documentation? (Guide > Overview)
Because in HN4 Docs. It didn't explain everything. Such as didn't tell the meaning of parameters, Example of command usage, etc.
I know now, you're focusing on developing HN5 and will never add more features into this HN4 but please improve the documentation.
I'm telling you about this because I don't want to bother you in this forum much.
So you can be focusing more on HN5 without worry that I will ask you about command usage.

I know I'll ask more questions in the future. Like "How can I ...", "Can HyperNext do this?", etc.
But Improving documentation will make me understand how can I use that command without bothering you.

I hope you'll see this and fixing the documentation.
8
General / Re: HyperNext 5.0
« Last post by Malkom on September 17, 2020, 02:24:15 PM »
Thank you for asking.

Actually I don't know for certain. Although most of the conversion is quite easy, the GUI functionality is much more complex.

I'm using Libre Project to keep track of things but it doesn't give a timeline, just a rough percentage of work needed for each module, subroutine, function etc.

HN 5 Creator is still not yet capable of fully running the Chart Demo project.
It can compile most of the scripts into runtime code but the Runtime Engine still needs a few weeks more work.

The GUI, card designer, and control dragging all need more work - yet another few weeks.

Then there is the testing and debugging before release.
The Windows OS version will be released first, followed by Linux.
OS X needs a lot of work, especially to run on OS X Catalina.

Although the current version of HN 5 runs on both Windows 7 and Lubuntu, no OS X versions has even been built yet.

Once the Chart Demo is working smoothly, then HN 5 Creator can be released, and no doubt lots of bugs will show up.

HN Player V5 will be released at the same time as HN Creator.

HN Developer creates HN plugins, but should not need much work as its very similar to Creator, except for some GUI differences.

Please note, these are all alphas.
 


9
General / HyperNext 5.0
« Last post by LinesOfCodes on September 17, 2020, 10:23:22 AM »
I want to ask you, The developer. What day you have planned to release HyperNext 5.0?
10
Files / Re: Run external program with parameters
« Last post by Malkom on September 14, 2020, 10:47:53 AM »
Hello,

Unfortunately the HN command to launch a program/file cannot send parameters to the target.

However, a work-around is to create a simple batch file with HN and then use this to launch the target with necessary parameters.

Attached is a very basic project that converts a video using FFmpeg on Windows X64 - the download link is at the bottom of this post.

The project just has one button and one field.
The location of FFmpeg is hardcoded in the script, and the final video is called Video1.mkv
The video to be converted is selected via a dialog box.

Note, the video source path has " (quotation marks) appended around it,  in case the full path contains spaces.
I didn't do this for the converted file path as it is just saved to the project directory.


Most of the code just displays information into field 1 as to aid debugging.

Also, FolderItemLaunch(fvar,1) executes the FFmpeg in the foreground to aid debugging.
Just use - FolderItemLaunch(fvar,0) to launch it in the background.

Code: [Select]
Local fname,fvar,fdetails,ftypes,fpaths,fnames,fextens
Local fhandle
 
Local sourcePath

Clear field 1

@ --- Get file ---
Put '--- Get file ---' after field 1
FileAskFilter(fname,'',fhandle,fdetails,ftypes,fpaths,fnames,fextens)
Put fname after field 1
Put line 9 of fdetails into sourcePath
Put sourcePath after field 1


@ --- Create batch file ---
Local batchname
Put ' ' after field 1
Put '--- Create batch file ---' after field 1

Put MyDirectoryFN into batchname
Append FolderSeparatorFN onto batchname
Append 'mybatch.bat' onto batchname
Put batchname after field 1
OpenTWriteAbs(batchname,fvar)


@ --- Build batch file ---
Local commandLine
Put ' ' after field 1
Put '--- Build batch file ---' after field 1
WriteTLine(fvar, 'ECHO OFF')
Put 'C:\ffmpeg-win64\bin\ffmpeg.exe -i ' into commandLine
Append '"' onto commandLine
Append sourcePath onto commandLine
Append '"' onto commandLine
Append ' -c copy ' onto commandLine
Append 'Video1.mkv ' onto commandLine
Put commandLine after field 1
WriteTLine(fvar,commandLine)
WriteTLine(fvar, 'PAUSE')
CloseTWrite(fvar)


@ --- Run batch file ---
Put ' ' after field 1
Put '--- Run batch file ---' after field 1
FolderItemGetAbs(batchname,fvar,fdetails,ftypes,fpaths,fnames,fextens)
FolderItemLaunch(fvar,1)
Put 'DONE' after field 1


 
Pages: [1] 2 3 ... 10
anything