EditorGadget Autoscroll and DOS 8bits characterset

Just starting out? Need help? Post your questions and find answers here.
marc_256
Addict
Addict
Posts: 855
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

EditorGadget Autoscroll and DOS 8bits characterset

Post by marc_256 »

Hello,

Q1)
For my Serial terminal RS232/RS485 program,
I want to see the last sended and received string in the two [EditorGadgets]
- [EditorGadget] -> Receive data
- [EditorGadget] -> Send data

I use "#ES_AUTOVSCROLL", but this is not working ?

Code: Select all

EditorGadget (10, 50, 40, 500, 300, #PB_Editor_ReadOnly | #ES_AUTOVSCROLL)

Q2)
As my robot is an old MC68000 board, it uses only DOS 8 bits character set.
I like to use on the PC the Courier New font as OEM-US style.
How can I fix this in my program, can I include the font inside the program ?

Image

Image



Thanks for the help and advice,
Marco
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
User avatar
jacdelad
Addict
Addict
Posts: 2019
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: EditorGadget Autoscroll and DOS 8bits characterset

Post by jacdelad »

Regarding the first question: I don't understand the question. What exactly is not working, the screenshot looks fine to me?!

Regarding the second question: The font should be preinstalled by default, but if you want to include it anyway: Find the font file in the Windows font directory, copy it into your program folder and use the RegisterFontFile()-function to register (load it the usual way afterwards).
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
User avatar
HeX0R
Addict
Addict
Posts: 1207
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: EditorGadget Autoscroll and DOS 8bits characterset

Post by HeX0R »

A1:

Code: Select all

Procedure LogIT(Text.s, GadgetID = -1)
	If Text
		Text = FormatDate("%hh:%ii:%ss", Date()) + " " + Text
	EndIf
	If GadgetID <> -1
		AddGadgetItem(GadgetID, -1, Text)
		CompilerSelect #PB_Compiler_OS
			CompilerCase #PB_OS_Windows
				Select GadgetType(GadgetID)
					Case #PB_GadgetType_ListView
						SendMessage_(GadgetID(GadgetID), #LB_SETTOPINDEX, CountGadgetItems(GadgetID) - 1, #Null)
					Case #PB_GadgetType_ListIcon
						SendMessage_(GadgetID(GadgetID), #LVM_ENSUREVISIBLE, CountGadgetItems(GadgetID) - 1, #False)
					Case #PB_GadgetType_Editor
						SendMessage_(GadgetID(GadgetID), #EM_SCROLLCARET, #SB_BOTTOM, 0)
				EndSelect
			CompilerCase #PB_OS_Linux
				Protected *Adjustment.GtkAdjustment
				*Adjustment = gtk_scrolled_window_get_vadjustment_(gtk_widget_get_parent_(GadgetID(Gadget)))
				*Adjustment\value = *Adjustment\upper
				gtk_adjustment_value_changed_(*Adjustment)
		CompilerEndSelect 
	EndIf

EndProcedure
marc_256
Addict
Addict
Posts: 855
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Re: EditorGadget Autoscroll and DOS 8bits characterset

Post by marc_256 »

@ jacdelad

thanks,
I tested the program,
I'm trying to integrate it in my program and have some problems.
But i am not giving up ...


@ HeXOR

Works very well, I used wrong control.
I am not a windows specialist so ...

thanks,
marco
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
infratec
Always Here
Always Here
Posts: 7640
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: EditorGadget Autoscroll and DOS 8bits characterset

Post by infratec »

User avatar
jacdelad
Addict
Addict
Posts: 2019
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: EditorGadget Autoscroll and DOS 8bits characterset

Post by jacdelad »

marc_256 wrote: Wed Jan 11, 2023 11:23 am @ jacdelad

thanks,
I tested the program,
I'm trying to integrate it in my program and have some problems.
But i am not giving up ...
You just have to add

Code: Select all

RegisterFontFile("D:\MyFontFile.ttf")
before LoadFont(). The font is now automatically available in your program (if it doesn't fail, so maybe check the return value).
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
marc_256
Addict
Addict
Posts: 855
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Re: EditorGadget Autoscroll and DOS 8bits characterset

Post by marc_256 »

Hi jacdelad,

I just found "MS Line Draw" font on line.
This is just what I need for my old robot communication.
This is a "Courier New" based font ...
So I downloaded the file as "MS_Line_Draw.ttf"

Image

I go try this, I hope I can put it directly in my programs directory.

Thanks,
Marco
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
infratec
Always Here
Always Here
Posts: 7640
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: EditorGadget Autoscroll and DOS 8bits characterset

Post by infratec »

I give up.

You did not read my link. There is shown how to integrate the font directly via include in your exe and load it from memory.
I also provided you links to free fonts with line draw symbols.
marc_256
Addict
Addict
Posts: 855
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Re: EditorGadget Autoscroll and DOS 8bits characterset

Post by marc_256 »

Hi infratec,

Sorry, but I downloaded the fonts DOSVGA437 and DOSVGA437Win ...
And tested what you told me, but it did not work for me.
Probably it is my missing of knowledge :oops:

So, I was looking for new fonts, with the needed line characters.

thanks,
Marco
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
Post Reply