Author Topic: Task Dialogs in QB64 (v1.5 64 bit only, Vista and up)  (Read 4614 times)

0 Members and 1 Guest are viewing this topic.

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Task Dialogs in QB64 (v1.5 64 bit only, Vista and up)
« on: July 01, 2021, 01:19:10 am »
I've been working on this library for a few days but I actually started a long time ago when I first discovered their existence. At the time, I believed Task Dialogs were impossible to implement in QB64. Then I found out about Michael Calkins' code (shared by Petr here) for Win32 UI controls, which used a callback function. Browsing that thread, I found where Fellippe mentioned manifest files. Combining those two aspects has finally made Task Dialogs a reality. If you want to know what a task dialog is, you can check out the videos on the forum post here or read the MSDN page about them here.

I've made lots of comments and provided the URLs for where I have obtained each function, constant, and structure. There is an abundance of information available to you.
I coded this on Windows 11 Pro 64 bit build 21H2 which gives rounded edges to the dialogs as well as some new button styling. Each version of Windows will experience the task dialog with the same functionality but may have a slightly different appearance due to inherent styling of the OS. I expect many questions about usage and issues you may face. Feel free to ask away either here or on Discord.

Here is a picture from running the test file:
 
Screenshot 2021-07-01 011830.png


TaskDlg.BI
Code: QB64: [Select]
  1. $If VERSION < 1.5 Then
  2.     $ERROR Requires 1.5 or higher to compile
  3.  
  4. $If 32BIT Then
  5.     $ERROR Requires 64 bit
  6.  
  7. 'Constants used to identify values used for custom buttons and the msg variable in the TaskDlgCallback function
  8. 'Consult this MSDN link: https://docs.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-taskdialog_button
  9. Const TDCBF_OK_BUTTON = &H1
  10. Const TDCBF_YES_BUTTON = &H2
  11. Const TDCBF_NO_BUTTON = &H4
  12. Const TDCBF_CANCEL_BUTTON = &H8
  13. Const TDCBF_RETRY_BUTTON = &H10
  14. Const TDCBF_CLOSE_BUTTON = &H20 'Only used for creation of a Close button. msg will return TDCBF_CANCEL_BUTTON for a Close button as they have the same functionality
  15.  
  16. 'Constants used with TASKDIALOGCONFIG.nDefaultButton
  17. Const IDCANCEL = 2
  18. Const IDNO = 7
  19. Const IDOK = 1
  20. Const IDRETRY = 4
  21. Const IDYES = 6
  22.  
  23. 'Flags used with TASKDIALOGCONFIG.dwFlags. Can be any combination except those that contradict one another
  24. 'Consult this MSDN link: https://docs.microsoft.com/en-us/windows/win32/api/Commctrl/ns-commctrl-taskdialogconfig
  25. Const TDF_ENABLE_HYPERLINKS = &H1 'Used to enable hyperlink usage, with syntax similar to html. Can be used in the body, expando, and footer. Syntax for hyperlink: <A HREF="executablestring or webpage">Hyperlink Text</A>
  26. Const TDF_USE_HICON_MAIN = &H2 'Although the hIconMain member is not being used in my type declaration, it occupies the same space as TASKDIALOGCONFIG.pszMainIcon. An HICON returned from the ExtractIcon Win32 function can be used with this flag
  27. Const TDF_USE_HICON_FOOTER = &H4 'Similar to the above, hIconFooter occupies the same space as TASKDIALOGCONFIG.pszIconFooter. An HICON returned from the ExtractIcon Win32 function can be used with this flag
  28. Const TDF_ALLOW_DIALOG_CANCELLATION = &H8 'Allows dialog to be closed using Alt+F4, Escape, and the title bar's close button even if no cancel/close button is defined in TASKDIALOG.dwCommonButtons or TASKDIALOG.pButtons
  29. Const TDF_USE_COMMAND_LINKS = &H10 'uses command links rather than normal buttons. All text before a newline character (Chr$(10)) will be the main text. All text after a newline character will be a footnote
  30. Const TDF_USE_COMMAND_LINKS_NO_ICON = &H20 'same as above, but no icons on the buttons. Do not use in conjunction with TD_USE_COMMAND_LINKS. All text before a newline character (Chr$(10)) will be the main text. All text after a newline character will be a footnote
  31. Const TDF_EXPAND_FOOTER_AREA = &H40 'TASKDIALOGCONFIG.pszExpandedInformation will be displayed at the bottom of the footer instead of immediately after the content element
  32. Const TDF_EXPANDED_BY_DEFAULT = &H80 'Expando element will be already expanded on creation of the dialog by default
  33. Const TDF_VERIFICATION_FLAG_CHECKED = &H100 'Checkbox element will be already expanded on creation of the dialog by default
  34. Const TDF_SHOW_PROGRESS_BAR = &H0200 'A progress bar element will be created and displayed in the dialog on creation
  35. Const TDF_SHOW_MARQUEE_PROGRESS_BAR = &H0400 'A progress bar element will be created and use the marquee style on creation
  36. Const TDF_CALLBACK_TIMER = &H0800 'A timer will be initialized for the TaskDlgCallback function. wParam in the TaskDlgCallback function will contain the time elapsed since creation when handling the TDN_TIMER message
  37. Const TDF_POSITION_RELATIVE_TO_WINDOW = &H1000 'Dialog box will be centered relative to the parent window specified in TASKDIALOG.hwndParent
  38. Const TDF_RTL_LAYOUT = &H2000 'Text will be displayed reading right to left
  39. Const TDF_NO_DEFAULT_RADIO_BUTTON = &H4000 'No radio button will be selected by default
  40. Const TDF_CAN_BE_MINIMIZED = &H8000 'Allows dialog to be minimized
  41. Const TDF_SIZE_TO_CONTENT = &H1000000 'Dialog will be autosized to fit the body (content) area. Ignored if TASKDIALOGCONFIG.cxWidth is not 0
  42.  
  43. 'Messages returned in the msg variable of the TaskDlgCallback function
  44. 'Consult this MSDN link: https://docs.microsoft.com/en-us/windows/win32/controls/bumper-task-dialogs-reference-notifications
  45. Const TDN_BUTTON_CLICKED = 2 'Button has been clicked. wParam is nonzero if checked, zero if unchecked.
  46. Const TDN_CREATED = 0 'Dialog is displayed
  47. Const TDN_DESTROYED = 5 'Dialog has been destroyed either by user or program error
  48. Const TDN_DIALOG_CONSTRUCTED = 7 'Dialog has been created and ready to be displayed
  49. Const TDN_EXPANDO_BUTTON_CLICKED = 10 'Expando has been clicked. wParam is nonzero if checked, zero if unchecked.
  50. Const TDN_HELP = 9 'F1 key has been pressed
  51. Const TDN_HYPERLINK_CLICKED = 3 'Hyperlink text has been clicked. lParam contains a pointer to the wide char string for the hyperlink clicked.
  52. Const TDN_NAVIGATED = 1 'Dialog has changed pages/forms
  53. Const TDN_RADIO_BUTTON_CLICKED = 6 'Radio button has been clicked. wParam in TaskDlgCallback contains the ID of the radio button
  54. Const TDN_TIMER = 4 'Is sent every 200 ms. wParam contains the total elapsed time since dialog creation
  55. Const TDN_VERIFICATION_CLICKED = 8 'Checkbox clicked. wParam is nonzero if checked, zero if unchecked.
  56.  
  57. 'Flags used with SendMessage to update the dialog box after creation
  58. 'Consult this MSDN link: https://docs.microsoft.com/en-us/windows/win32/controls/bumper-task-dialogs-reference-messages
  59. Const WM_USER = &H0400
  60. Const TDM_CLICK_BUTTON = WM_USER + 102 'Simulating clicking a button on the dialog. Example: SendMessage(hwnd, TDM_CLICK_BUTTON,TDCBF_NO_BUTTON, 0)
  61. Const TDM_CLICK_RADIO_BUTTON = WM_USER + 110 'Simulating clicking a radio button on the dialog. Example: SendMessage(hwnd, TDM_CLICK_RADIO_BUTTON, 1, 0)
  62. Const TDM_CLICK_VERIFICATION = WM_USER + 113 'Simulating clicking the checkbox on the dialog. 1 for checked, 0 for unchecked. Example: SendMessage(hwnd, TDM_CLICK_VERIFICATION, 1, 0)
  63. Const TDM_ENABLE_BUTTON = WM_USER + 111 'Enables or disables a button on the dialog. Nonzero for enabled, 0 for disabled. Example: SendMessage(hwnd, TDM_ENABLE_BUTTON, TDCBF_YES_BUTTON, 1)
  64. Const TDM_ENABLE_RADIO_BUTTON = WM_USER + 112 'Enables or disables a radio button on the dialog. Nonzero for enabled, 0 for disabled. Example: SendMessage(hwnd, TDM_ENABLE_RADIO_BUTTON, 2, 0)
  65. Const TDM_NAVIGATE_PAGE = WM_USER + 101 'Causes dialog to change to new form/page. You create a new TASKDIALOGCONFIG variable and pass it with _Offset in the lParam argument of SendMessage. Example: SendMessage(hwnd, TDM_NAVIGATE_PAGE, 0, _Offset(newTaskDialogPage))
  66. Const TDM_SET_BUTTON_ELEVATION_REQUIRED_STATE = WM_USER + 115 'Places shield icon on button or command link to notify that the action will require elevation. Example: SendMessage(hwnd, TDM_SET_BUTTON_ELEVATION_REQUIRED_STATE, TDCBF_YES_BUTTON, 1)
  67. Const TDM_SET_ELEMENT_TEXT = WM_USER + 108 'Can update text in content, expando info, footer, and header. Example: SendMessage(hwnd, TDM_SET_ELEMENT_TEXT, TDE_CONTENT, _Offset(newTextString)) 'This will also require that the string be null-terminated and converted to Unicode
  68. Const TDM_SET_MARQUEE_PROGRESS_BAR = WM_USER + 103 'Sets the status of marquee mode for progress bar. 1 for enabled, 0 for disabled. Example: SendMessage(hwnd, TDM_SET_MARQUEE_PROGRESS_BAR, 1, 0)
  69. Const TDM_SET_PROGRESS_BAR_MARQUEE = WM_USER + 107 'Turns marquee display on or off and sets animation speed. Example: SendMessage(hwnd, TDM_SET_PROGRESS_BAR_MARQUEE, 1, 20)
  70. Const TDM_SET_PROGRESS_BAR_POS = WM_USER + 106 'Updates the progress bar to a new value to indicate progress. Example: SendMessage(hwnd, TDM_SET_PROGRESS_BAR_POS, 50, 0)
  71. Const TDM_SET_PROGRESS_BAR_RANGE = WM_USER + 105 'Sets range of progress bar. Use MAKELPARAM to make a new range. Example: SendMessage(hwnd, TDM_SET_PROGRESS_BAR_RANGE, 0, MAKELONG(10, 120))
  72. Const TDM_SET_PROGRESS_BAR_STATE = WM_USER + 104 'Sets state of progress bar. Example: SendMessage(hwnd, TDM_SET_PROGRESS_BAR_STATE, PBST_PAUSED, 0)
  73. Const TDM_UPDATE_ELEMENT_TEXT = WM_USER + 114 'Same result as TDM_SET_ELEMENT_TEXT
  74. Const TDM_UPDATE_ICON = WM_USER + 116 'Updates the main or footer icon. Example: SendMessage(hwnd, TDM_UPDATE_ICON, TDIE_ICON_MAIN, TD_SHIELD_ICON)
  75.  
  76. 'Flags used with SendMessage and TDM_UPDATE_ELEMENT_TEXT or TDM_SET_ELEMENT_TEXT to specify which element to update
  77. Const TDE_CONTENT = 0
  78. Const TDE_EXPANDED_INFORMATION = 1
  79. Const TDE_FOOTER = 2
  80. Const TDE_MAIN_INSTRUCTION = 3
  81.  
  82. 'Flags used with SendMessage and TDM_UPDATE_ICON to specify which icon to update
  83. Const TDIE_ICON_MAIN = 0
  84. Const TDIE_ICON_FOOTER = 1
  85.  
  86. 'Flags used with SendMessage and TDM_SET_PROGRESS_BAR_STATE to change state of the progress bar
  87. Const PBST_NORMAL = 1
  88. Const PBST_PAUSED = 3
  89. Const PBST_ERROR = 2
  90.  
  91. 'Type used in an array to define each individual custom button or radio button displayed
  92. 'Consult this MSDN link: https://docs.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-taskdialog_button
  93. Type TASKDIALOG_BUTTON
  94.     As Long nButtonID 'Can be any TDCBF button constant or number identifying radio button
  95.     As _Offset pszButtonText 'The custom text to be displayed in the button. Must be null-terminated (Chr$(0)) and use ANSIToUnicode conversion
  96.  
  97. 'Type used to specify configuration of a new task dialog.
  98. 'Consult this MSDN link: https://docs.microsoft.com/en-us/windows/win32/api/Commctrl/ns-commctrl-taskdialogconfig
  99. Type TASKDIALOGCONFIG
  100.     As _Unsigned Long cbSize 'Mandatory and must be set so the API knows how large the TYPE is. Set this element using Len and passing the name of the TASKDIALOGCONFIG structure
  101.     As _Offset hwndParent, hInstance 'hInstance is optional and most always will be zero. hwndParent is optional and can be _WindowHandle or zero.
  102.     As Long dwFlags, dwCommonButtons 'dwFlags can be any combination of TDF flags, with exceptions of some that contradict one another. dwCommonButtons can be any TDCBF button constant
  103.     As _Offset pszWindowTitle, pszMainIcon, pszMainInstruction, pszContent 'All four are pointers to strings with the exception of pszMainIcon. pszMainIcon references any icon listed in tdicon.h or icon returned from ExtractIcon and using the appropriate flag
  104.     As _Unsigned Long cButtons 'Refers to the number of buttons in the TASKDIALOG_BUTTON structure array
  105.     As _Offset pButtons 'Pointer to an array of TASKDIALOG_BUTTON structures
  106.     As Long nDefaultButton 'The default button that will be highlighted in the dialog. Can be any ID constant
  107.     As _Unsigned Long cRadioButtons 'Refers to the number of buttons in the TASKDIALOG_BUTTON structure array
  108.     As _Offset pRadioButtons 'Pointer to an array of TASKDIALOG_BUTTON structures
  109.     As Long nDefaultRadioButton 'ID for default radio button
  110.     'The following are all pointers to null-terminated, Unicode strings. pszVerificationText sets checkbox text. pszExpandedInformation sets expando info.
  111.     'pszExpandedControlText sets text contained in expando. pszCollapsedControlText sets text of collapsed expando.
  112.     'pszFooter icon refers to any icon in tdicon.h or icon returned from ExtractIcon with the appropriate flag enabled. pszFooter is a null-terminated, Unicode string to set footer text. pfCallback is set to the TaskDialogCallback function pointer which calls our TaskDlgCallback function
  113.     'lpCallbackdata is a pointer to any data needed to be passed to the dialog's callback function. I recommend using a _MEM block so you can store anything in any amount and then unpack it in the callback function
  114.     As _Offset pszVerificationText, pszExpandedInformation, pszExpandedControlText, pszCollapsedControlText, pszFooterIcon, pszFooter, pfCallback, lpCallbackData
  115.     As _Unsigned Long cxWidth 'Sets width of dialog. If 0, task dialog will calculate ideal width
  116.  
  117. 'Consult this MSDN link: https://docs.microsoft.com/en-us/windows/win32/api/commctrl/nf-commctrl-taskdialogindirect
  118.     Function TaskDialogIndirect%& (ByVal pTaskConfig As _Offset, Byval pnButton As _Offset, Byval pnRadioButton As _Offset, Byval pfVerificationFlagChecked As _Offset)
  119.  
  120. 'Tests for success. Consult this MSDN link: https://docs.microsoft.com/en-us/windows/win32/api/winerror/nf-winerror-succeeded
  121. Declare Library ".\internal\c\c_compiler\x86_64-w64-mingw32\include\winerror"
  122.     Function SUCCEEDED%% (ByVal hr As _Offset)
  123.  
  124. Declare CustomType Library "tdicon" 'This library contains all the common icons I could find to use with this setup
  125.     Function TD_ERROR_ICON%& Alias "task_error_icon"
  126.     Function TD_WARNING_ICON%& Alias "task_warning_icon"
  127.     Function TD_INFORMATION_ICON%& Alias "task_info_icon"
  128.     Function TD_SHIELD_ICON%& Alias "task_shield_icon"
  129.     Function TD_SEC_SHIELD_ICON%& Alias "task_sec_shield" 'TD_SEC icons have banners
  130.     Function TD_SEC_WARN_ICON%& Alias "task_sec_warning"
  131.     Function TD_SEC_ERROR_ICON%& Alias "task_sec_error"
  132.     Function TD_SEC_SUCCESS_ICON%& Alias "task_sec_success"
  133.  
  134. 'This is the function that returns a pointer to the callback function.
  135. 'Consult this MSDN link:https://docs.microsoft.com/en-us/windows/win32/api/commctrl/nc-commctrl-pftaskdialogcallback
  136.     Function TaskDialogCallback%& Alias "TaskDialogCallbackProc"
  137.  
  138. 'This is the function that is used to update the dialog box.
  139. 'Consult this MSDN link: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendmessage
  140.     Function SendMessage%& (ByVal hWnd As _Offset, Byval Msg As _Unsigned Long, Byval wParam As _Unsigned _Offset, Byval lParam As _Offset)
  141.  
  142. 'Gets handle to icon from a DLL, exe, or icon
  143. 'Consult this MSDN link: https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-extracticona
  144. Declare Library ".\internal\c\c_compiler\x86_64-w64-mingw32\include\shellapi"
  145.     Function ExtractIcon%& Alias "ExtractIconA" (ByVal hInst As _Offset, pszExeFileName As String, Byval nIconIndex As _Unsigned Long)
  146.  
  147. 'Creates a value to use as an lParam in the SendMessage function.
  148. 'Consult this MSDN link: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-makelparam
  149.     Function MAKELPARAM%& (ByVal l As Integer, Byval h As Integer)
  150.  
  151. 'This library is being left commented out for now as it was used in testing and may be used again if it will be useful enough
  152. 'Consult this MSDN link: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-makeintresourcea
  153. 'Declare CustomType Library "makeint"
  154. '    Function MAKEINTRESOURCE%& Alias "MAKEINTRSC" (ByVal i As Long)
  155. 'End Declare

TaskDlg.BM
Code: QB64: [Select]
  1. Function TaskDlgCallback%& (hwnd As _Offset, msg As _Unsigned Long, wParam As _Unsigned _Offset, lParam As _Offset, lpRefData As _Offset)
  2.     'This function will need to be updated to fit your needs and perform with the correct logic. I have provided you with the proper select case.
  3.     'What you do from there is up to you
  4.     Select Case msg
  5.         Case TDN_BUTTON_CLICKED
  6.             Select Case wParam
  7.                 Case TDCBF_OK_BUTTON
  8.                 Case TDCBF_YES_BUTTON
  9.                 Case TDCBF_NO_BUTTON
  10.                 Case TDCBF_CANCEL_BUTTON
  11.                 Case TDCBF_RETRY_BUTTON
  12.                     'Close button is returned as Cancel in this message. TDCBF_CLOSE_BUTTON is used only to identify a button to create
  13.             End Select
  14.         Case TDN_CREATED 'Dialog is displayed
  15.         Case TDN_DESTROYED 'Dialog has been exited in some way
  16.         Case TDN_DIALOG_CONSTRUCTED 'Dialog is ready to be displayed
  17.         Case TDN_EXPANDO_BUTTON_CLICKED
  18.             If wParam Then 'Dialog is expanded
  19.             Else 'Dialog is collapsed
  20.             End If
  21.         Case TDN_HELP 'Activated when F1 is pressed while dialog has focus
  22.         Case TDN_HYPERLINK_CLICKED 'Pointer to string containing hyperlink is stored in lParam
  23.             'If lParam Then 'checking that the value isn't 0
  24.             '    Dim As String hyperlink
  25.             '    hyperlink = wCharPtrToString(lParam) 'converting the lParam pointer to an ANSI string
  26.             'End If
  27.         Case TDN_NAVIGATED 'Activated when the dialog changes pages/forms
  28.         Case TDN_RADIO_BUTTON_CLICKED
  29.             'wParam will equal the ID of the radio button that was clicked. This ID is set with TASKDIALOG_BUTTON.nButtonID
  30.         Case TDN_TIMER
  31.             Dim As _Unsigned _Offset dialogElapsedTime
  32.             dialogElapsedTime = wParam 'store the elapsed time since dialog creation
  33.         Case TDN_VERIFICATION_CLICKED
  34.             If wParam Then 'checkbox is checked
  35.             Else 'checkbox is unchecked
  36.             End If
  37.     End Select
  38.  
  39. Function wCharPtrToString$ (wchar As _Offset)
  40.     'Function returns the length of a wide char (Unicode) string referenced by a pointer
  41.     'Consult this MSDN link: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/strlen-wcslen-mbslen-mbslen-l-mbstrlen-mbstrlen-l?view=msvc-160
  42.         Function wcslen%& (ByVal str As _Offset)
  43.     End Declare
  44.     Dim As _Offset wlen: wlen = wcslen(wchar) * 2 'The length does not account for the 2-byte nature of Unicode so we multiply by 2
  45.     Dim As _MEM pChar: pChar = _Mem(wchar, wlen) 'Declaring a new _MEM block and setting it to grab the number of bytes referenced by wlen at pointer wchar
  46.     Dim As String char: char = Space$(wlen) 'Declaring a new string large enough to hold the unicode string
  47.     _MemGet pChar, pChar.OFFSET, char 'Storing the data in the string
  48.     _MemFree pChar 'Freeing the _MEM block
  49.     wCharPtrToString = UnicodeToANSI(char) 'Returning the converted Unicode string
  50.  
  51. 'This include contains both ANSIToUnicode and UnicodeToANSI
  52. 'Consult these MSDN links:
  53. 'https://docs.microsoft.com/en-us/windows/win32/api/stringapiset/nf-stringapiset-widechartomultibyte
  54. 'https://docs.microsoft.com/en-us/windows/win32/api/stringapiset/nf-stringapiset-multibytetowidechar
  55. '$INCLUDE:'unicodetoansi.bas'

Dependencies:
An example manifest file: You can save this and rename to "your program name.exe.manifest", replacing "your program name" with your program's name
unicodetoansi.bas: 
TaskDialog callback header: 
Icon set header: 
Header containing function MAKEINTRESOURCE. Not necessary right now, but including it: 

Example file with lots of elements added. Play around with it and test different combos:  Remember, you'll need a manifest file. You can download the one above. It's already named properly.
« Last Edit: July 01, 2021, 09:29:35 am by SpriggsySpriggs »
Shuwatch!

FellippeHeitor

  • Guest
Re: Task Dialogs in QB64 (v1.5 64 bit only, Vista and up)
« Reply #1 on: July 01, 2021, 09:05:30 am »
This is an amazing wrapper library project. It's been a thrill to follow the development.

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
    • View Profile
Re: Task Dialogs in QB64 (v1.5 64 bit only, Vista and up)
« Reply #2 on: July 01, 2021, 09:43:11 am »
Great Job!! Also, its like 2 threads are running, because whenever I clicked on checkboxes/radiobuttons the program automatically detects it.
if (Me.success) {Me.improve()} else {Me.tryAgain()}


My Projects - https://github.com/AshishKingdom?tab=repositories
OpenGL tutorials - https://ashishkingdom.github.io/OpenGL-Tutorials

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Re: Task Dialogs in QB64 (v1.5 64 bit only, Vista and up)
« Reply #3 on: July 01, 2021, 10:35:08 am »
Nice work! I haven’t tried it. I’m in 32-bit. But it looks good.

- Dav

Offline jack

  • Seasoned Forum Regular
  • Posts: 408
    • View Profile
Re: Task Dialogs in QB64 (v1.5 64 bit only, Vista and up)
« Reply #4 on: July 01, 2021, 11:23:03 am »
nice :)

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: Task Dialogs in QB64 (v1.5 64 bit only, Vista and up)
« Reply #5 on: July 01, 2021, 01:58:32 pm »
@SpriggsySpriggs

That looks absolutely great. Great job. Are you testing it in both 32-bit and 64-bit versions of the IDE? This is definitely a big step forward. I am absolutely sure that I will use it in my programs (all possible setup dialogs in programs settings and so). Thank you very much!

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: Task Dialogs in QB64 (v1.5 64 bit only, Vista and up)
« Reply #6 on: July 01, 2021, 02:01:23 pm »
@Petr No, this is 64 bit only.
Shuwatch!

Offline madscijr

  • Seasoned Forum Regular
  • Posts: 295
    • View Profile
Re: Task Dialogs in QB64 (v1.5 64 bit only, Vista and up)
« Reply #7 on: July 02, 2021, 09:50:24 am »
I've been working on this library for a few days but I actually started a long time ago when I first discovered their existence. At the time, I believed Task Dialogs were impossible to implement in QB64.

Very cool! I don't need this right now, but I bookmarked this in case I ever do.

Now, here is a question / challenge for you or any Linux or Mac-based QB64 programmers:
Can this be somehow duplicated for those operating systems?

And even if it can't be duplicated right now, is the interface for it "agnostic"
so that a Mac or Linux version of the include files could just be dropped in,
without having to make any changes to a person's main program?

One thing I like about QB64 is that it runs on all the major PC operating systems.
Even if some underlying functionality has to be programmed in an OS-specific way,
as long as it's put in an include file with non-OS-specific signatures/interfaces,
then theoretically all you have to do to get it to work in a different OS is
drop swap in the include file for the desired OS, without any changes to the rest of the program
(assuming someone figures out how to do whatever functionality in that OS!)

« Last Edit: July 02, 2021, 09:52:30 am by madscijr »

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: Task Dialogs in QB64 (v1.5 64 bit only, Vista and up)
« Reply #8 on: July 02, 2021, 09:53:35 am »
@madscijr This is very much Windows-specific but I suppose someone could possibly create a version of it by creating a child window in Mac or Linux and go through the trouble of making a similar interface.
Shuwatch!

Offline George McGinn

  • Global Moderator
  • Forum Regular
  • Posts: 210
    • View Profile
    • Resume
Re: Task Dialogs in QB64 (v1.5 64 bit only, Vista and up)
« Reply #9 on: July 26, 2021, 08:49:36 pm »
I could do that in Zenity for Linux!

@madscijr This is very much Windows-specific but I suppose someone could possibly create a version of it by creating a child window in Mac or Linux and go through the trouble of making a similar interface.
____________________________________________________________________
George McGinn
Theoretical/Applied Computer Scientist
Member: IEEE, IEEE Computer Society
Technical Council on Software Engineering
IEEE Standards Association
American Association for the Advancement of Science (AAAS)