Author Topic: Windows buttons for 32 and 64 bit IDE - Take 2  (Read 8440 times)

0 Members and 1 Guest are viewing this topic.

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: Windows buttons for 32 and 64 bit IDE - Take 2
« Reply #15 on: October 11, 2021, 12:04:17 pm »
I was working on making a full-fledged library for Win32 GUIs using the controls in their own wrappers. I have all the fonts and things working. Sometime I'll post it and let y'all monkey around with it. It was started long ago but I took a break from it. Trying to make it as user-friendly as possible.
Shuwatch!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Windows buttons for 32 and 64 bit IDE - Take 2
« Reply #16 on: October 11, 2021, 12:26:21 pm »
Well I hope you guys can integrate that with QB64, man! I have a Dream!

Offline Aurel

  • Forum Regular
  • Posts: 167
    • View Profile
Re: Windows buttons for 32 and 64 bit IDE - Take 2
« Reply #17 on: October 11, 2021, 02:03:27 pm »
Quote
@Aurel you have an AurelEdit version for QB64?

yes Mark i have ,i think that first version i made last year when i want to try few qb64 programs
most of them are yours , it work well even is not featured (i am lazy to add some things ) probably
i don't need them in my programming
//////////////////////////////////////////////////////////////////
https://aurelsoft.ucoz.com
https://www.facebook.com/groups/470369984111370
//////////////////////////////////////////////////////////////////

Offline Aurel

  • Forum Regular
  • Posts: 167
    • View Profile
Re: Windows buttons for 32 and 64 bit IDE - Take 2
« Reply #18 on: October 11, 2021, 05:03:55 pm »
from the unknown reason to me
rich edit control is not recognized
as
RICHEDIT
or
RICHEDIT20A

any hint ?

Code: QB64: [Select]
  1. '-- RichEdit control
  2.     t0 = "RICHEDIT20A" + CHR$(0) 'predefined class
  3.     t1 = "This is a" + CrLf + "multiline edit control." + CrLf + "Click in me and type." + CrLf + "It should scroll automatically in both directions, but there aren't any scroll bars." + CrLf + "Close the window to see the text printed to the console." + CHR$(0)
  4.     hwRE = CreateWindowExA(WS_EX_CLIENTEDGE, _OFFSET(t0), _OFFSET(t1), WS_VSCROLL OR WS_HSCROLL OR WS_TABSTOP OR WS_VISIBLE OR WS_CHILD OR ES_AUTOHSCROLL OR ES_AUTOVSCROLL OR ES_LEFT OR ES_MULTILINE OR ES_WANTRETURN, 170, 360, 150, 120, hw, 0, hi, 0)
  5.      
//////////////////////////////////////////////////////////////////
https://aurelsoft.ucoz.com
https://www.facebook.com/groups/470369984111370
//////////////////////////////////////////////////////////////////

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: Windows buttons for 32 and 64 bit IDE - Take 2
« Reply #19 on: October 11, 2021, 05:18:27 pm »
I'd search the appropriate header and look at all the string constants for the various control types.
Shuwatch!

Offline Aurel

  • Forum Regular
  • Posts: 167
    • View Profile
Re: Windows buttons for 32 and 64 bit IDE - Take 2
« Reply #20 on: October 12, 2021, 04:13:32 am »
Zak
It looks that richedit control need LoadLibrary to load riched20.dll in order to work
i use similar method in o2
//////////////////////////////////////////////////////////////////
https://aurelsoft.ucoz.com
https://www.facebook.com/groups/470369984111370
//////////////////////////////////////////////////////////////////

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: Windows buttons for 32 and 64 bit IDE - Take 2
« Reply #21 on: October 12, 2021, 08:20:10 am »
I'll look at it sometime.
Shuwatch!

Offline mpgcan

  • Newbie
  • Posts: 26
    • View Profile
Re: Windows buttons for 32 and 64 bit IDE - Take 2
« Reply #22 on: October 12, 2021, 10:35:33 am »
To get you up and running edit file window_controls_7.bas as follows:
Code: QB64: [Select]
  1.  
  2. '1)--Under Libaries add the following:
  3.  
  4. '2)--under Variables add the following:
  5. Dim Shared hwRe1 As _Offset 'Rich edit control
  6.  
  7. '3)---change this line as shown. Increases window size:
  8. hw = CreateWindowExA(0, _Offset(className), _Offset(t1), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 432, 640, 0, 0, hi, 0): If 0 = hw Then System
  9.  
  10. '4)---A the end of Edit multiline control section
  11. '---add the following section:
  12.  
  13. '5)---Richedit control
  14. t0 = "RICHEDIT50W" + Chr$(0) 'predefined class
  15. t1 = "This is a" + CrLf + "Multiline Richedit control." + CrLf + "Click in me and type." + CrLf + "It should scroll automatically in both directions, but there aren't any scroll bars." + CrLf + "Close the window to see the text printed to the console." + Chr$(0)
  16.  
  17. hwRe1 = CreateWindowExA(WS_EX_CLIENTEDGE, _Offset(t0), _Offset(t1), WS_VISIBLE Or WS_CHILD or WS_VSCROLL Or WS_HSCROLL Or ES_MULTILINE Or ES_WANTRETURN, 10, 460, 400, 120, hw, 0, hi, 0): If 0 = hwRe1 Then System
  18.  

Quick test , after compiling, copy a image into the Richedit control as follows:
Navigate to qb64\source\ right click on file qb64.ico and select copy. Place mouse in Richedit control and press ctrl+v
Expected result image displayed in Rich edit control

Offline Aurel

  • Forum Regular
  • Posts: 167
    • View Profile
Re: Windows buttons for 32 and 64 bit IDE - Take 2
« Reply #23 on: October 12, 2021, 01:11:50 pm »
thanks mpg
i must say that i never see before that m$ library name and most of my programming
is GUI programming..."Msftedit"
so i changed it by loading dll name

Code: QB64: [Select]
  1. 'load richEd20.dll...
  2.  

and then create rich edit control , also i strech main window to 800 px to put
control on right side of window ES_SUNKEN is just addition style and muliline is created with
constant &H50B010C4
here is code :
Code: QB64: [Select]
  1. '-- RichEdit control ...&H50B010C4 is multiline richedit constant to minimize typing
  2.     reID = 400  ' control ID
  3.     t0 = "RICHEDIT20A" + CHR$(0) ' class name
  4.     t1 = "This is a multiline" + Crlf + "Rich edit control." + CrLf + "Click in me and type." + CrLf + "It should scroll automatically in both directions" + CrLf + "Close the window to see the text printed to the console." + CHR$(0)
  5.     hwRE = CreateWindowExA(WS_EX_CLIENTEDGE, _OFFSET(t0), _OFFSET(t1), &H50B010C4 OR ES_SUNKEN , 410, 24, 380, 400, hw, reID, 0, 0)
  6.      

I am not sure why string need to use _OFFSET...is this string pointer or general purpose pointer which just read content from
variable address ..but ok ..
qb64_RichEdit.png
* qb64_RichEdit.png (Filesize: 68.13 KB, Dimensions: 911x652, Views: 306)
//////////////////////////////////////////////////////////////////
https://aurelsoft.ucoz.com
https://www.facebook.com/groups/470369984111370
//////////////////////////////////////////////////////////////////

Offline mpgcan

  • Newbie
  • Posts: 26
    • View Profile
Re: Windows buttons for 32 and 64 bit IDE - Take 2
« Reply #24 on: October 13, 2021, 06:03:12 am »
RichEdit versions 1.0, 2.0, 3.0 and 4.1 were included in Windows at various times. Not sure which one corresponds to what version of Windows. I used the latest version which may not be appropriate for your requirements. See this page  https://docs.microsoft.com/en-us/windows/win32/controls/about-rich-edit-controls .
Quote
I am not sure why string need to use _OFFSET...is this string pointer or general purpose pointer which just read content from
variable address ..but ok ..

I think the following best explains why they are string pointers:

LPCTSTR lpClassName –pointer to a null-terminated string containing the predefined control-class names.  The class name can either be one created with RegisterClass or one of the predefined classes used to create child controls. However although the lpClassName is declared to be an LPCTSTR it can be either a pointer to a string or a class atom returned by RegisterClass or RegisterClassEx.

LPCTSTR lpWindowName – pointer to a null-terminated string that specifies the window name.