Icons with Segoe-Fluent-Icons-Font [Win (10,11) Only]
Posted: Sat Mar 15, 2025 4:38 pm
Hey folks,
Here is another attempt to program something “beautiful”.
Even if I would win every ugly design award with my program interfaces I also try to incorporate graphic elements.
Now I have come across the following Segoe Fluent Icons Font and immediately wrote a little brainstorming program.
Maybe someone can use it as a start for its own challenges.....
Before you copy and test the code.
The Font comes with Windows 11 only, but for Windows 10 you can download it here.
Here is another attempt to program something “beautiful”.
Even if I would win every ugly design award with my program interfaces I also try to incorporate graphic elements.
Now I have come across the following Segoe Fluent Icons Font and immediately wrote a little brainstorming program.
Maybe someone can use it as a start for its own challenges.....
Before you copy and test the code.
The Font comes with Windows 11 only, but for Windows 10 you can download it here.
Code: Select all
;/
;| File : TestSegoeFluentIconsFont.pb
;|
;| License: Free, unrestricted, no warranty whatsoever.
;| cobbled together by Axolotl - All Rights reserved.
;\
EnableExplicit
Enumeration EWindow 1
#WND_Main
EndEnumeration
Enumeration EGadget 1
#GDT_txtStayOnTop ; Pin or UnPin
#GDT_btnNav
#GDT_btnDown
#GDT_btnUp
#GDT_btnSettings
;
#GDT_edtText
EndEnumeration
Enumeration EFont 1
#FNT_Monospace ; ==> LoadFont(#FNT_Monospace, "Consolas", 8)
#FNT_Icons ; ==> LoadFont(#FNT_Icons, "Segoe Fluent Icons", 8)
EndEnumeration
;/---------------------------------------------------------------------------------------------------------------------
;| ■ Info about Segoe Fluent Icons Font
;|
;| LINK: https://learn.microsoft.com/en-us/windows/apps/design/style/segoe-fluent-icons-font
;|
;| Selection of Chars (Icons)
;|
#SFI_GlobalNavButton = $e700 ; GlobalNavButton
#SFI_GlobalNavButton$ = Chr($e700) ;
;|
#SFI_ChevronDown = $e70d ; ChevronDown
#SFI_ChevronDown$ = Chr($e70d) ;
;|
#SFI_ChevronUp = $e70e ; ChevronUp
#SFI_ChevronUp$ = Chr($e70e) ;
;|
#SFI_ChevronLeft = $e76b ; ChevronLeft
#SFI_ChevronLeft$ = Chr($e76b) ;
;|
#SFI_ChevronRight = $e76c ; ChevronRight
#SFI_ChevronRight$ = Chr($e76c) ;
;|
#SFI_Settings = $e713 ; Settings
#SFI_Settings$ = Chr($e713) ;
;|
#SFI_Pin = $e718 ; Pin
#SFI_Pin$ = Chr($e718) ;
;|
#SFI_UnPin = $e77a ; UPin
#SFI_UnPin$ = Chr($e77a) ;
;|
;\---
;/---------------------------------------------------------------------------------------------------------------------
;| Brain storming stuff ..... ?
;\---
Procedure Main()
If OpenWindow(#WND_Main, 0, 0, 320, 240, "Segoe Fluent Icons Example ....", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
; Gadgets and Buttons with Fluent Icons .....
;
SetGadgetFont(#PB_Default, LoadFont(#FNT_Icons, "Segoe Fluent Icons", 8))
; Clickable TextGadget as ButtonGadget replacement .....
;
TextGadget(#GDT_txtStayOnTop, 2, 2, 20, 20, #SFI_UnPin$, #SS_CENTER | #SS_CENTERIMAGE | #SS_NOTIFY) ; Pin or UnPin
SetGadgetColor(#GDT_txtStayOnTop, #PB_Gadget_BackColor, #White)
; Standard ButtonGadgets
;
ButtonGadget(#GDT_btnNav, 32, 0, 24, 24, #SFI_GlobalNavButton$)
ButtonGadget(#GDT_btnDown, 58, 0, 24, 24, #SFI_ChevronDown$)
ButtonGadget(#GDT_btnUp, 84, 0, 24, 24, #SFI_ChevronUp$)
; .....
ButtonGadget(#GDT_btnSettings, 294, 0, 24, 24, #SFI_Settings$)
; EditorGadget with default font .....
;
SetGadgetFont(#PB_Default, #PB_Default)
; Editor (for further use)
EditorGadget(#GDT_edtText, 0, 24, 320, 216) ; instead of Debug
AddGadgetItem(#GDT_edtText, -1, "Important Hint: ")
AddGadgetItem(#GDT_edtText, -1, " The Font comes with Win 11 only, ")
AddGadgetItem(#GDT_edtText, -1, " but for Win 10 you can download it.")
AddGadgetItem(#GDT_edtText, -1, "")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break ; say bye.
Case #PB_Event_Gadget
Select EventGadget()
Case #GDT_txtStayOnTop
If GetGadgetText(#GDT_txtStayOnTop) = #SFI_Pin$
SetGadgetText(#GDT_txtStayOnTop, #SFI_UnPin$)
StickyWindow(#WND_Main, 0)
AddGadgetItem(#GDT_edtText, -1, "Not Top Most Window anymore")
Else
SetGadgetText(#GDT_txtStayOnTop, #SFI_Pin$)
StickyWindow(#WND_Main, 1)
AddGadgetItem(#GDT_edtText, -1, "Top Most Window again")
EndIf
Case #GDT_btnNav To #GDT_btnSettings
AddGadgetItem(#GDT_edtText, -1, "Under construction. Try later. ")
EndSelect
EndSelect
ForEver
EndIf
ProcedureReturn 0
EndProcedure
End Main()
;\ Bottom of File