September 22, 2019, 08:51:54 pm

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Recent posts

Pages1 2 3 ... 10
1
General Questions / Re: Here is a new (french) cha...
Last post by drfloyd - Today at 09:07:53 am
ok, thank you for this reply

Yes, it seems very fast, with short .EXE, and cool commands (near from BLITZ)

So there is no .PNG in native, I should use a library . Strange, as .PNG is the most popular format.

I will think about these USD 67...
2
General Questions / Re: Here is a new (french) cha...
Last post by Egil - Today at 06:27:34 am
Hi Dr Floyd,

IW Basic is a very powerful language. And with this package you can make your own special tools if needed, something which is not easily done, if not impossible, with most other basics I have tried. And USD 67 is a rather low price, compared with other, non BASIC, programming languages abling you to do the same.

Some years ago user LarryMc posted a taylor made graphical library for IW Basic: https://www.ionicwind.com/forums/index.php?topic=5510.msg45727#msg45727

And a year ago user fasecero posted his code for making a similar library: https://www.ionicwind.com/forums/index.php?topic=6210.msg45637#msg45637
The latter demonstrates clearly how easy it is to code your own "special" tools using IW Basic.

Regards,
Egil
3
General Questions / Here is a new (french) challen...
Last post by drfloyd - Today at 12:18:28 am
Hello,

Dr Floyd from France, sorry for my bad english, i will try to do my best.

I am the admin of a big french retrocomputing/gaming forum (GAMOPAT), and a big fan of basic langages since 8bit computers in then 80'... Then I used Dark basic, QB64, BLITZ 3D,to produce games like this ones :
http://gamopat.over-blog.com/page-8134772.html

Since several years I try to find a good basic (not easy!). I just discover IW basic... in sept 2019 !

First question :
Is your basic still commercial ? Or can i download the full version free ?

Second question :
In the doc there is nothing about .PNG images... Can we use .PNG images ?

Thank you !
4
The Roundtable / Re: MessageBox replacement
Last post by LarryMc - September 19, 2019, 10:37:39 am
Nice!
5
The Roundtable / MessageBox replacement
Last post by fasecero - September 19, 2019, 07:16:28 am
A task dialog is similar to, while much more flexible than, a basic message box.

A task dialog contains application-defined message text and title, icons, any combination of predefined push buttons, additional and footer messages, verification check box, command links, and hyperlinks. You can kinda guide the user in more detail through the decision he/she has to make.

The code uses some programming stuff: dynamic link libraries (calling a system function dynamically), function callback (custom message processing), dynamic variables (to bypass the requirement of 'fixed' arrays), and referencing and dereferencing pointers to those dynamic variables. Anyway, the resulting functions are very easy to use.

The following is an over-exaggerated illustration of a: yes/no/cancel messagebox: "Do you want to save the changes before exiting?"

Requirement: Windows Vista+, Windows Styles enabled (you need to use a .manifest file)

Code Select
$INCLUDE "windowssdk.inc"
$INCLUDE "commctrl.inc"
$INCLUDE "Uxtheme.inc"

$USE "Uxtheme.lib"

' -------------------------------------------------------------------------------------------------------------------------------------------------------
' TASK DIALOG CUSTOM STRUCT
' -------------------------------------------------------------------------------------------------------------------------------------------------------

TYPE _TASKDIALOG
TASKDIALOGCONFIG config
pointer textbt
pointer bt
INT nButtonPressed
BOOL pfVerificationFlagChecked
ENDTYPE

' -------------------------------------------------------------------------------------------------------------------------------------------------------
' MAIN LOOP
' -------------------------------------------------------------------------------------------------------------------------------------------------------

OleInitialize(0) ' THIS IS MANDATORY + VISUAL STYLES ENABLED
ShowTaskDialog()
OleUninitialize()
END

' -------------------------------------------------------------------------------------------------------------------------------------------------------
' TASK DIALOG EXAMPLE
' -------------------------------------------------------------------------------------------------------------------------------------------------------

SUB ShowTaskDialog()
_TASKDIALOG task
string url = "<A HREF=\"http://www.ionicwind.com/forums/index.php\">Ionic Wind</A>" ' ' standard hyperlink format

' INIT THE TASK DIALOG
' arguments: parent HWND
TaskDialogInit(task, 0)

/* BEGIN OF TASK DIALOG SECTIONS */
/* comment any section to skip it */

' HEADER INFO
' arguments: caption, title, description, icon: TD_ERROR_ICON, TD_WARNING_ICON, TD_INFORMATION_ICON, TD_SHIELD_ICON, OPT custom HICON
TaskDialogSetHeader(task, L"Confirmation", L"What do you want to do with your current progress?", L"", TD_INFORMATION_ICON, 0)

' USER COMMAND BUTTONS
' arguments: number of buttons, default button ID
TaskDialogSetCommandLinks(task, 3, IDCANCEL)
' arguments: position, button ID, title, description
TaskDialogCommandSetInfo(task, 1, 100, "Exit and save my changes", "Save you progress, then exit. This will overwrite any previosely saved project.")
TaskDialogCommandSetInfo(task, 2, 101, "Exit and don't save", "Exit without saving the file. This will discard any change you did to the file.")
TaskDialogCommandSetInfo(task, 3, 102, "Don't exit!", "Return to your current file.")

' SYSTEM COMMAND BUTTONS
'arguments: buttons: TDCBF_OK_BUTTON | TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON | TDCBF_RETRY_BUTTON | TDCBF_CLOSE_BUTTON
TaskDialogSetSystemButtons(task, TDCBF_CANCEL_BUTTON)

' CUSTOM CHECKBOX
' arguments: text, checked
TaskDialogSetCheckbox(task, L"Don't ask me again / autosave next time", FALSE)

' EXPANDABLE ADITIONAL INFO
' arguments: expanded, text, expand button text, collapse button text
TaskDialogSetExpandableInfo(task, FALSE, L"Note: If you need more information please visit "+ S2W(url) + L" forum.", L"View details", L"Hide details")

' FOOTER INFO
' arguments: text, icon: TD_ERROR_ICON, TD_WARNING_ICON, TD_INFORMATION_ICON, TD_SHIELD_ICON, OPT custom HICON
TaskDialogSetFooter(task, L"If you don't choose to save your changes will be lost.", TD_INFORMATION_ICON, 0)

/* comment any section to skip it */
/* END OF TASK DIALOG SECTIONS */

' SHOW THE TASK DIALOG ON THE SCREEN
ShowTask(task)

' RELEASE TASK DIALOG DATA (call it every time you finish with one taskdialog and before using TaskDialogInit again )
TaskDialogFinish(task)

' DISPLAY THE USER'S CHOICE (you can also get checkbox's value with task.pfVerificationFlagChecked)
SELECT (task.nButtonPressed)
CASE IDCANCEL
_MessageBox(0, "The user has cancelled the task dialog", "", 0)
DEFAULT
_MessageBox(0, "The user has selected the button ID: " + STR$(task.nButtonPressed), "", 0)
ENDSELECT
ENDSUB

' -------------------------------------------------------------------------------------------------------------------------------------------------------
' TASK DIALOG FUNCTIONS
' -------------------------------------------------------------------------------------------------------------------------------------------------------

SUB TaskDialogInit(_TASKDIALOG task, HWND parent)
ZeroMemory(&task, LEN(task))

task.config.hwndParent = parent
task.config.cbSize                       = LEN(task.config)
task.config.hInstance                    = GetModuleHandle(0)

task.config.dwFlags = task.config.dwFlags | TDF_ENABLE_HYPERLINKS
ENDSUB

' sysbuttons: TDCBF_OK_BUTTON | TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON | TDCBF_RETRY_BUTTON | TDCBF_CLOSE_BUTTON
SUB TaskDialogSetSystemButtons(_TASKDIALOG task, INT sysbuttons)
task.config.dwCommonButtons = sysbuttons
ENDSUB

' headerIcon (only 1 value): TD_ERROR_ICON, TD_WARNING_ICON, TD_INFORMATION_ICON, TD_SHIELD_ICON
SUB TaskDialogSetHeader(_TASKDIALOG task, wstring caption, wstring title, wstring description, INT headerIcon, OPT INT customIcon = 0)
task.config.pszWindowTitle               = caption
task.config.pszMainInstruction           = title
task.config.pszContent                   = description

IF customIcon THEN
task.config.hMainIcon = customIcon
task.config.dwFlags = task.config.dwFlags | TDF_USE_HICON_MAIN
task.config.pszMainIcon = 0
ELSE
IF headerIcon THEN
task.config.pszMainIcon = MAKEINTRESOURCE(headerIcon)
ELSE
task.config.pszMainIcon = 0
ENDIF
ENDIF
ENDSUB

TYPE myString
wstring text
ENDTYPE

SUB TaskDialogSetCommandLinks(_TASKDIALOG task, INT numberOfCommands, INT defaultID)
pointer textbt = NEW(myString, numberOfCommands)
pointer bt = NEW(TASKDIALOG_BUTTON, numberOfCommands)

task.textbt = textbt + 0
task.bt = bt + 0
task.config.dwFlags                     = task.config.dwFlags | TDF_USE_COMMAND_LINKS
task.config.cButtons                     = numberOfCommands
task.config.pButtons                     = task.bt + 0
task.config.nDefaultButton             = defaultID
ENDSUB

SUB TaskDialogCommandSetInfo(_TASKDIALOG task, INT pos, INT id, string title, string description)
pointer textbt = task.textbt + 0
pointer bt = task.bt + 0

#<myString>textbt[pos - 1].text = GenerateUnicodeCommandLinkText(title, description)
#<TASKDIALOG_BUTTON>bt[pos - 1].pszButtonText = #<myString>textbt[pos - 1].text
#<TASKDIALOG_BUTTON>bt[pos - 1].nButtonID = id
ENDSUB

SUB TaskDialogFinish(_TASKDIALOG task)
pointer textbt = task.textbt + 0
pointer bt = task.bt + 0

IF textbt THEN DELETE(textbt)
IF bt THEN DELETE(bt)
ENDSUB

SUB TaskDialogSetCheckbox(_TASKDIALOG task, wstring text, INT checked)
task.config.pszVerificationText = text
IF checked THEN task.config.dwFlags = task.config.dwFlags | TDF_VERIFICATION_FLAG_CHECKED
ENDSUB

SUB TaskDialogSetExpandableInfo(_TASKDIALOG task, INT expanded, wstring info, wstring expandText, wstring collapseText)
task.config.pszExpandedInformation     = info
task.config.pszExpandedControlText     = collapseText
task.config.pszCollapsedControlText     = expandText

IF expanded THEN task.config.dwFlags = task.config.dwFlags | TDF_EXPANDED_BY_DEFAULT
task.config.dwFlags = task.config.dwFlags | TDF_EXPAND_FOOTER_AREA
ENDSUB

' headerIcon (only 1 value): TD_ERROR_ICON, TD_WARNING_ICON, TD_INFORMATION_ICON, TD_SHIELD_ICON
SUB TaskDialogSetFooter(_TASKDIALOG task, wstring text, INT footerIcon, OPT INT customIcon = 0)
task.config.pszFooter               = text

IF customIcon THEN
task.config.hFooterIcon = customIcon
task.config.dwFlags = task.config.dwFlags | TDF_USE_HICON_FOOTER
task.config.pszFooterIcon = 0
ELSE
IF footerIcon THEN
task.config.pszFooterIcon = MAKEINTRESOURCE(footerIcon)
ELSE
task.config.pszFooterIcon = 0
ENDIF
ENDIF
ENDSUB

SUB ShowTask(_TASKDIALOG task), INT
task.config.pfCallback = &Pftaskdialogcallback
_TaskDialogIndirect(&task.config, &task.nButtonPressed, NULL, &task.pfVerificationFlagChecked)
RETURN task.nButtonPressed
ENDSUB

' TASK DIALOG NOTIFICATIONS
' TDN_BUTTON_CLICKED, TDN_CREATED, TDN_DESTROYED, TDN_DIALOG_CONSTRUCTED, TDN_EXPANDO_BUTTON_CLICKED
' TDN_HELP, TDN_HYPERLINK_CLICKED, TDN_NAVIGATED, TDN_RADIO_BUTTON_CLICKED, TDN_TIMER, TDN_VERIFICATION_CLICKED
SUB Pftaskdialogcallback(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, LONG_PTR lpRefData), HRESULT
HRESULT hr = S_OK

SELECT msg
CASE TDN_CREATED
'setMainThemeAttributes(hwnd)
CASE TDN_HYPERLINK_CLICKED
SYSTEM(W2S(*<wstring>lParam))
ENDSELECT

RETURN hr
ENDSUB

SUB GenerateUnicodeCommandLinkText(string title, string text), WSTRING
WSTRING buffer = S2W(title) + L"|" + S2W(text) + WCHR$(10) + L" "

INT pos = WINSTR(buffer, L"|") - 1

IF pos THEN
pointer p = &buffer[pos] + 0
*<char>p = 10 : p+=1 : *<char>p = 0
ENDIF

RETURN buffer
ENDSUB

DECLARE TaskDialogIndirectTemplate(pointer pTaskConfig, pointer pnButton, pointer pnRadioButton, pointer pfVerificationFlagChecked), HRESULT

SUB _TaskDialogIndirect(pointer pTaskConfig, pointer pnButton, pointer pnRadioButton, pointer pfVerificationFlagChecked), HRESULT
HRESULT value = 0
UINT hInst=LoadLibraryW(L"ComCtl32.dll")

IF hInst THEN
UINT proc = GetProcAddress(hInst, "TaskDialogIndirect")

IF proc THEN
value = !<TaskDialogIndirectTemplate>proc(pTaskConfig, pnButton, pnRadioButton, pfVerificationFlagChecked)
ENDIF

FreeLibrary(hInst)
ENDIF

RETURN value
ENDSUB

SUB setMainThemeAttributes(int hwnd)
WTA_OPTIONS options

options.dwFlags = WTNCA_NODRAWCAPTION | WTNCA_NODRAWICON
options.dwMask = WTNCA_VALIDBITS

' The SetWindowThemeAttribute API call takes care of everything
SetWindowThemeAttribute(hwnd, WTA_NONCLIENT, options, LEN(options))
ENDSUB

6
User Offerings / Re: League Tables program
Last post by Brian - September 16, 2019, 06:38:35 am
Hi,

After a bit more testing, I have updated the league tables program. New stuff includes:

Added bitmaps to menu items
Added a bitmap to the statusbar
Added a Preferences dialog. Now you can set whether the last-used table opens automatically when the program runs
Added checkboxes. To enter points, just select two teams, and press Ctrl+E or press the Enter button. No need to hold the Control key down to do a multiselect now
Updated the help file, using Fasecero's excellent HTML Help Workshop tutorial
Moved bitmaps, icons and manifest file into their own folder
Various other tweaks

As before, you just need the exe and CHM file for it to run. Compile as a Project

I have removed the zip in the first post, so use this one

Brian
7
General Questions / Re: Listviews
Last post by Brian - September 14, 2019, 09:51:53 am
Bill,

Yes, you have to hold the Control key down for multiple selections. Just wondered if I could do it with just clicking, without the Control key

I suppose you could include check marks - then you can single click

Brian
8
General Questions / Re: Listviews
Last post by billhsln - September 14, 2019, 09:39:54 am
Manual says:

@LVSSINGLESEL

Allows only one item at a time to be selected. By default, multiple items can be selected.

So, you should be able to select more than 1 at a time.

Bill
9
General Questions / Listviews
Last post by Brian - September 14, 2019, 04:58:12 am
Help! How do I format a listview control so that I can select one line, and then a second line, without the first line selection disappearing?

Brian
10
Windows/Anti-Virus/Other Utilities / Tutorial: Create your own .chm...
Last post by fasecero - September 12, 2019, 05:47:15 pm
I was playing with the program Brian shared recently and I noticed on his .chm file the tool he used to create it. You can check his program in here http://www.ionicwind.com/forums/index.php?topic=6312.msg46255;topicseen#msg46255

here is a small tutorial on how to create a .chm by yourself:

Tools needed:
 - WordPad
 - HTML Help Workshop
 - Online Converter (.rtf to .html)

And here it goes:

1) Download and install HTML Help Workshop (htmlhelp.exe): https://www.microsoft.com/en-us/download/details.aspx?id=21138
   (Note: there's a chance you already have it, search your main menu for "HTML Help Workshop")

2) Write your help files on Wordpad (for this tutorial I'm just copy-pasting Brian's files)

3) Convert them (.rtf files) to .html using any online file converter. I'm using: http://www.convertfiles.com/index.php you have to go 1 by 1 but it does the job :). Put all your .html on a new folder.

4) Open HTML Help Workshop
   - Select File - New - Project, a Wizard window will appears, click Next
   - Press Browse, navigate to your .html folder and write the project Name, select Open, click Next
   - You should see now 3 checkboxes, mark the third one (HTML files (.htm)), click Next
   - Click on Add, select all your .html files, click Next, then Finish.

5) Now you have your own .chm project opened
   - Select Contents tab, it will ask you if you want to create a new contents file, click OK.
   - A Save dialog will appears, select Save

6) Use the left button's bar to add files, folders, and to move them up, down, right, etc.

7) Create the intro page
   - Select Insert a Page button (check the button's tooltips to locate it), Insert the name in Entry title, press Add and choose the intro file. Click OK.

8) Add a folder
   - Select Insert a Heading button, choose NO, Insert the name, and click OK.

9) Repeat point 7) to each file menu.

10) Press the last button (Save) to save all. Finally, at the top bar press Compile HTML File, after that press Compile again. Save your changes and that's it, the .chm should appears in your .html folder.

Aditional settings
   - Project tab - Change project options button
         On General tab you can change the .chm title, default file, and .chm left pane font.
         On Compiler tab select Compile Full-text search information, so you can perform any search on your .chm file.
   - Index tab
         You can add important keywords and relate them to some of your files.

I'm attaching the resulting folder below, but it is recommended that you start with an empty folder and follow those steps.
Pages1 2 3 ... 10