Control pensado para seleccionar tipo de fuente rapidamente y comodamente, con la opción de poner fuente predeterminada con un solo clic.
parte gráfica del control (ffontname) formulario
' gambas class file
'by postapase 18 de enero 2017
'http://novatocodegambas.blogspot.com.uy/
'control FontName
Event Reset
Event Seleccion
Event Enter
Public Sub Form_Open()
End
Public Sub btnFontDefault_Click()
Raise Reset
End
Public Sub cbxNombreFuentes_Click()
Raise Seleccion
End
Public Sub btnFontDefault_Enter()
Raise Enter
End
'by postapase 18 de enero 2017
'http://novatocodegambas.blogspot.com.uy/
'control FontName
Event Reset
Event Seleccion
Event Enter
Public Sub Form_Open()
End
Public Sub btnFontDefault_Click()
Raise Reset
End
Public Sub cbxNombreFuentes_Click()
Raise Seleccion
End
Public Sub btnFontDefault_Enter()
Raise Enter
End
clase fontname
' gambas class file
'by postapase 18 de enero 2017
'http://novatocodegambas.blogspot.com.uy/
'control FontName
Export
Inherits UserControl
Public Const _Properties As String = "*,Predeterminada,Seleccionada,Index"
Public Const _DefaultEvent As String = "Seleccion"
Public Const _DefaultSize As String = "32,4"
Public Const _Group As String = "Chooser"
Event Seleccion
Event Reseteo ''Selecciona la fuente predeterminada de la aplicación
Property Predeterminada As String
Property Seleccionada As String
Property Index As Integer
Private $xfontname As Ffontname
Private $Predeterminada As String
Private $Seleccionada As String
Private $Index As Integer
Private $ListaFuentes As New String[]
Public Sub _new()
$xfontname = New Ffontname(Me) As "Ev"
$Predeterminada = Application.Font.Name
$Seleccionada = $Predeterminada
Me.Proxy = $xfontname.cbxNombreFuentes
ActualizarFuentes()
End
Public Sub Ev_Reset()
Reinicio()
Raise Reseteo
End
Public Sub Ev_Seleccion()
$Seleccionada = $xfontname.cbxNombreFuentes.Current.Text
$Index = $xfontname.cbxNombreFuentes.Index
Raise Seleccion
End
Public Sub EV_Enter()
$xfontname.btnFontDefault.Tooltip = "Seleccionar fuente predeterminada [ " & $Predeterminada & " ]"
End
Public Sub ActualizarFuentes()
Dim NombreFuente As String
For Each NombreFuente In Fonts
$ListaFuentes.Add(NombreFuente)
Next
$xfontname.cbxNombreFuentes.List = $ListaFuentes
$xfontname.cbxNombreFuentes.Add($Predeterminada, 0)
End
Private Function Predeterminada_Read() As String
Return $Predeterminada
End
Private Sub Predeterminada_Write(Value As String)
$Predeterminada = Value
End
Private Function Seleccionada_Read() As String
Return $Seleccionada
End
Private Sub Seleccionada_Write(Value As String)
$Seleccionada = Value
End
Private Function Index_Read() As Integer
Return $Index
End
Private Sub Index_Write(Value As Integer)
$Index = Value
$xfontname.cbxNombreFuentes.Index = $Index
End
Public Sub Reinicio()
$xfontname.cbxNombreFuentes.Index = 0
$Index = 0
En
'by postapase 18 de enero 2017
'http://novatocodegambas.blogspot.com.uy/
'control FontName
Export
Inherits UserControl
Public Const _Properties As String = "*,Predeterminada,Seleccionada,Index"
Public Const _DefaultEvent As String = "Seleccion"
Public Const _DefaultSize As String = "32,4"
Public Const _Group As String = "Chooser"
Event Seleccion
Event Reseteo ''Selecciona la fuente predeterminada de la aplicación
Property Predeterminada As String
Property Seleccionada As String
Property Index As Integer
Private $xfontname As Ffontname
Private $Predeterminada As String
Private $Seleccionada As String
Private $Index As Integer
Private $ListaFuentes As New String[]
Public Sub _new()
$xfontname = New Ffontname(Me) As "Ev"
$Predeterminada = Application.Font.Name
$Seleccionada = $Predeterminada
Me.Proxy = $xfontname.cbxNombreFuentes
ActualizarFuentes()
End
Public Sub Ev_Reset()
Reinicio()
Raise Reseteo
End
Public Sub Ev_Seleccion()
$Seleccionada = $xfontname.cbxNombreFuentes.Current.Text
$Index = $xfontname.cbxNombreFuentes.Index
Raise Seleccion
End
Public Sub EV_Enter()
$xfontname.btnFontDefault.Tooltip = "Seleccionar fuente predeterminada [ " & $Predeterminada & " ]"
End
Public Sub ActualizarFuentes()
Dim NombreFuente As String
For Each NombreFuente In Fonts
$ListaFuentes.Add(NombreFuente)
Next
$xfontname.cbxNombreFuentes.List = $ListaFuentes
$xfontname.cbxNombreFuentes.Add($Predeterminada, 0)
End
Private Function Predeterminada_Read() As String
Return $Predeterminada
End
Private Sub Predeterminada_Write(Value As String)
$Predeterminada = Value
End
Private Function Seleccionada_Read() As String
Return $Seleccionada
End
Private Sub Seleccionada_Write(Value As String)
$Seleccionada = Value
End
Private Function Index_Read() As Integer
Return $Index
End
Private Sub Index_Write(Value As Integer)
$Index = Value
$xfontname.cbxNombreFuentes.Index = $Index
End
Public Sub Reinicio()
$xfontname.cbxNombreFuentes.Index = 0
$Index = 0
En
Saludos y espero sus opiniones.
Necesario estar registrado en https://www.gambas-es.org/
Descargar
Dropbox: fontname-0.1.2.tar.gz
No hay comentarios.:
Publicar un comentario