-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v1.9.0: Now uses modGTK3 from https://bitbucket.org/pidog/modgtk3/ (V…
…ersion from 2020-01-28) to improve size and layout of controls under Linux. Also updates the checkDoubleClick() to use the newer "gkt3" lib so that it won't crash on Linux when clicking into the textfield.
- Loading branch information
1 parent
1b6d4b9
commit e0265e9
Showing
7 changed files
with
800 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
#tag Class | ||
Protected Class GtkCssParsingErrorInfo | ||
#tag Method, Flags = &h0 | ||
Sub Constructor(provider as ptr, Section as ptr, error as ptr) | ||
#If TargetLinux | ||
|
||
Declare Function gtk_css_section_get_start_line Lib "libgtk-3" (obj as ptr) As uint32 | ||
Declare Function gtk_css_section_get_start_position Lib "libgtk-3" (obj as ptr) As uint32 | ||
Declare Function gtk_css_section_get_end_position Lib "libgtk-3" (obj as ptr) As uint32 | ||
Declare Function gtk_css_section_get_end_line Lib "libgtk-3" (obj as ptr) As uint32 | ||
Declare Function g_quark_to_string Lib "libgtk-3" (obj as ptr) As CString | ||
|
||
StartLine=gtk_css_section_get_start_line(Section) | ||
StartPosition=gtk_css_section_get_start_position(Section) | ||
Endline=gtk_css_section_get_end_line(Section) | ||
EndPosition=gtk_css_section_get_end_position(Section) | ||
|
||
me.Provider=provider | ||
|
||
ErrorMessage=error.CString(8) | ||
#Else | ||
#Pragma unused error | ||
#Pragma unused Section | ||
#Pragma unused provider | ||
#EndIf | ||
End Sub | ||
#tag EndMethod | ||
|
||
#tag Method, Flags = &h21 | ||
Private Shared Sub Gtk_parsing_error(GtkCssProvider as ptr, GtkCssSection as ptr, GError As ptr, data as ptr) | ||
#If TargetLinux | ||
|
||
LastParsingError=new GtkCssParsingErrorInfo(GtkCssProvider,GtkCssSection,GError) | ||
|
||
#Else | ||
#Pragma unused data | ||
#Pragma unused GError | ||
#Pragma unused GtkCssSection | ||
#Pragma unused GtkCssProvider | ||
#EndIf | ||
End Sub | ||
#tag EndMethod | ||
|
||
|
||
#tag Property, Flags = &h0 | ||
Endline As Integer | ||
#tag EndProperty | ||
|
||
#tag Property, Flags = &h0 | ||
EndPosition As Integer | ||
#tag EndProperty | ||
|
||
#tag Property, Flags = &h0 | ||
ErrorMessage As String | ||
#tag EndProperty | ||
|
||
#tag Property, Flags = &h0 | ||
Shared LastParsingError As modGTK3.GtkCssParsingErrorInfo | ||
#tag EndProperty | ||
|
||
#tag Property, Flags = &h0 | ||
Provider As ptr | ||
#tag EndProperty | ||
|
||
#tag Property, Flags = &h0 | ||
StartLine As Integer | ||
#tag EndProperty | ||
|
||
#tag Property, Flags = &h0 | ||
StartPosition As Integer | ||
#tag EndProperty | ||
|
||
|
||
#tag ViewBehavior | ||
#tag ViewProperty | ||
Name="Endline" | ||
Group="Behavior" | ||
Type="Integer" | ||
#tag EndViewProperty | ||
#tag ViewProperty | ||
Name="EndPosition" | ||
Group="Behavior" | ||
Type="Integer" | ||
#tag EndViewProperty | ||
#tag ViewProperty | ||
Name="ErrorMessage" | ||
Group="Behavior" | ||
Type="String" | ||
EditorType="MultiLineEditor" | ||
#tag EndViewProperty | ||
#tag ViewProperty | ||
Name="Index" | ||
Visible=true | ||
Group="ID" | ||
InitialValue="-2147483648" | ||
InheritedFrom="Object" | ||
#tag EndViewProperty | ||
#tag ViewProperty | ||
Name="Left" | ||
Visible=true | ||
Group="Position" | ||
InitialValue="0" | ||
InheritedFrom="Object" | ||
#tag EndViewProperty | ||
#tag ViewProperty | ||
Name="Name" | ||
Visible=true | ||
Group="ID" | ||
InheritedFrom="Object" | ||
#tag EndViewProperty | ||
#tag ViewProperty | ||
Name="StartLine" | ||
Group="Behavior" | ||
Type="Integer" | ||
#tag EndViewProperty | ||
#tag ViewProperty | ||
Name="StartPosition" | ||
Group="Behavior" | ||
Type="Integer" | ||
#tag EndViewProperty | ||
#tag ViewProperty | ||
Name="Super" | ||
Visible=true | ||
Group="ID" | ||
InheritedFrom="Object" | ||
#tag EndViewProperty | ||
#tag ViewProperty | ||
Name="Top" | ||
Visible=true | ||
Group="Position" | ||
InitialValue="0" | ||
InheritedFrom="Object" | ||
#tag EndViewProperty | ||
#tag EndViewBehavior | ||
End Class | ||
#tag EndClass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
#tag Class | ||
Private Class GtkEntryFixHandlerClass | ||
#tag Method, Flags = &h0 | ||
Sub constructor() | ||
|
||
#if TargetLinux | ||
FoundEntries=new Dictionary | ||
declare function g_signal_add_emission_hook lib "libgobject-2" (id as uint32,detail as int32,hook as ptr, notify as ptr) as uint32 | ||
declare function g_signal_lookup lib "libgobject-2" ( name as CString, type as uint32) as uint32 | ||
Declare Function gtk_widget_get_type Lib "libgtk-3" () As uint32 | ||
Declare Function gtk_entry_get_type Lib "libgtk-3" () As uint32 | ||
|
||
dim type as uint32=gtk_entry_get_type | ||
dim wtype as uint32=gtk_widget_get_type | ||
GtkEntryCallBackID=g_signal_add_emission_hook(g_signal_lookup("map",type),0,AddressOf GtkEntryFixCallback,nil) | ||
|
||
#endif | ||
End Sub | ||
#tag EndMethod | ||
|
||
#tag Method, Flags = &h0 | ||
Sub destructor() | ||
#if TargetLinux | ||
|
||
declare sub g_signal_remove_emission_hook lib "libgobject-2" (id as uint32,detail as int32) | ||
declare function g_signal_lookup lib "libgobject-2" ( name as CString, type as uint32) as uint32 | ||
Declare Function gtk_entry_get_type Lib "libgtk-3" () As uint32 | ||
|
||
dim type as uint32=gtk_entry_get_type | ||
g_signal_remove_emission_hook(g_signal_lookup("map",type),GtkEntryCallBackID) | ||
|
||
#endif | ||
End Sub | ||
#tag EndMethod | ||
|
||
#tag Method, Flags = &h21 | ||
Private Shared Function GtkEntryFixCallback(hint as ptr, count as uint32,params as ptr,data as ptr) As Boolean | ||
#If TargetLinux | ||
|
||
declare function g_value_get_object lib "libgtk-3" ( cls as ptr)as ptr | ||
declare function g_object_class_find_property lib "libgtk-3" ( cls as ptr, prop as cstring)as ptr | ||
Declare Sub g_object_set Lib "libgtk-3" (obj As ptr, name As CString, value As Int32,term As ptr=Nil) | ||
|
||
dim widget as ptr=g_value_get_object(params) | ||
|
||
if FoundEntries.HasKey(widget) then Return true | ||
|
||
dim prop as ptr=g_object_class_find_property(widget.ptr(0),"width-chars") | ||
if prop<>nil then | ||
g_object_set(widget, "width-chars", 0) | ||
end if | ||
|
||
FoundEntries.Value(widget)=1 | ||
|
||
Return true | ||
#Else | ||
#Pragma unused data | ||
#Pragma unused params | ||
#Pragma unused count | ||
#Pragma unused hint | ||
#EndIf | ||
End Function | ||
#tag EndMethod | ||
|
||
|
||
#tag Property, Flags = &h0 | ||
Shared FoundEntries As Dictionary | ||
#tag EndProperty | ||
|
||
#tag Property, Flags = &h21 | ||
Private GtkEntryCallBackID As uint32 | ||
#tag EndProperty | ||
|
||
|
||
#tag ViewBehavior | ||
#tag ViewProperty | ||
Name="Index" | ||
Visible=true | ||
Group="ID" | ||
InitialValue="-2147483648" | ||
InheritedFrom="Object" | ||
#tag EndViewProperty | ||
#tag ViewProperty | ||
Name="Left" | ||
Visible=true | ||
Group="Position" | ||
InitialValue="0" | ||
InheritedFrom="Object" | ||
#tag EndViewProperty | ||
#tag ViewProperty | ||
Name="Name" | ||
Visible=true | ||
Group="ID" | ||
InheritedFrom="Object" | ||
#tag EndViewProperty | ||
#tag ViewProperty | ||
Name="Super" | ||
Visible=true | ||
Group="ID" | ||
InheritedFrom="Object" | ||
#tag EndViewProperty | ||
#tag ViewProperty | ||
Name="Top" | ||
Visible=true | ||
Group="Position" | ||
InitialValue="0" | ||
InheritedFrom="Object" | ||
#tag EndViewProperty | ||
#tag EndViewBehavior | ||
End Class | ||
#tag EndClass |
Oops, something went wrong.