Page 1 of 1
EditorGadget Autoscroll and DOS 8bits characterset
Posted: Tue Jan 10, 2023 9:35 pm
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 ?
Thanks for the help and advice,
Marco
Re: EditorGadget Autoscroll and DOS 8bits characterset
Posted: Tue Jan 10, 2023 10:06 pm
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).
Re: EditorGadget Autoscroll and DOS 8bits characterset
Posted: Tue Jan 10, 2023 10:34 pm
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
Re: EditorGadget Autoscroll and DOS 8bits characterset
Posted: Wed Jan 11, 2023 11:23 am
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
Re: EditorGadget Autoscroll and DOS 8bits characterset
Posted: Wed Jan 11, 2023 12:45 pm
by infratec
Re: EditorGadget Autoscroll and DOS 8bits characterset
Posted: Wed Jan 11, 2023 10:18 pm
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).
Re: EditorGadget Autoscroll and DOS 8bits characterset
Posted: Wed Jan 11, 2023 10:42 pm
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"
I go try this, I hope I can put it directly in my programs directory.
Thanks,
Marco
Re: EditorGadget Autoscroll and DOS 8bits characterset
Posted: Wed Jan 11, 2023 11:09 pm
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.
Re: EditorGadget Autoscroll and DOS 8bits characterset
Posted: Thu Jan 12, 2023 12:26 am
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
So, I was looking for new fonts, with the needed line characters.
thanks,
Marco