Skip to content

Commit a3f5b4b

Browse files
author
jogicom
committed
Initial Commit
0 parents  commit a3f5b4b

12 files changed

+2388
-0
lines changed

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Folgende Dateien werden von Git ignoriert
2+
3+
# Die Einstellungen der lokalen UI
4+
*.xojo_uistate
5+
6+
# Den kompletten Build Ordner
7+
**/src/Builds -*
8+
9+
# Den Debug Folder
10+
**/src/Debug*
11+
12+
# Die vom INNO Installer erzeugte EXE
13+
Inno Installer/*.exe

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 jogicom
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# A extended DesktopListbox Class for Xojo
2+
3+
- Supports coloring of rows (odd/even)
4+
- In a multi-column list box, the entire row is highlighted
5+
- Inline edit, if a cell is editable, by slow SingleClicks within a certain time
6+
- No side effects to the functionality of the original DesktopListbox
7+
8+
I developed this class on XOJO 2022R4.1 on Windows 11 and only tested it on Windows.
9+
Unfortunately, I cannot guarantee whether it will work on other platforms.
10+
11+
If you want to contribute special code for other platforms, you are very welcome. If you find any errors, create an issue. It is quite possible that under certain conditions, not everything works as it should.
12+
13+
## What is the difference to DesktopListbox
14+
15+
- The new event **CellDoublePressed** have two parameter (row, column)
16+
17+
- The new event **CellSinglePressed** only occurs if a click was actually made only once. This event occurs with a time delay (see property SingleClickTime)
18+
19+
- The new event **CellEditRequest** only occurs when two slow SingleClicks have been performed on the same editable cell, within a certain time (see property EditTimeout). It should be **noted** that the **first click triggers a CellSinglePressed event**. In the original ListBox, a second click on the same cell would put it into EditMode, no matter how much time elapsed between clicks. Since this caused confusion for some users, this behavior has been optimized.
20+
21+
- In the original list box (MultiColumn), only the first column is highlighted, when it is selected. By setting the **HighlightSelection** property to true (default), the entire line is automatically highlighted. The colors are DarkMode capable and can be changed at runtime.
22+
23+
- even and odd rows can have different background and text colors. The option can be activated via the **colorizeRows** property (default is off). The colors are DarkMode capable and can be freely determined at runtime.
24+
25+
- All specified default colors can be changed at runtime. For example in the opening event or somewhere else.
26+
27+
28+
29+
## The new Propertys
30+
31+
| Property | Function | Type |
32+
| ------------------------ | ------------------------------------------------------------ | ---------- |
33+
| colorizeRows | If TRUE, the odd and even rows have different colors, see ColorOdd.... and ColorEven..... | Boolean |
34+
| HighlightSelection | If TRUE in MultiColumn Listbox, the hole row is marked as selected, see ColorHighlight..... | Boolean |
35+
| ColorEvenRowBackground | Background color for even rows | ColorGroup |
36+
| ColorEvenRowText | Text color for even rows | ColorGroup |
37+
| ColorHighlightBackground | Background color for a selected row | ColorGroup |
38+
| ColorHighlightText | Text color for a selected row | ColorGroup |
39+
| ColorOddRowBackground | Background color for odd rows | ColorGroup |
40+
| ColorOddRowText | Text color for odd rows | ColorGroup |
41+
| SingleClickTime | Two clicks within this time are evaluated as a DoublePressed event. A SinglePressed event is delayed by this time. You can adjust this at runtime. (default 250ms) | Integer |
42+
| EditTimeout | Two single clicks on the same editable cell immediately triggers an EditCellRequest event, if clicked in this time. You can adjust this at runtime. (default 5000ms) | Integer |
43+
44+
## The Events in detail
45+
46+
**Event CellDoublePressed(row as Integer, column as Integer)**
47+
48+
```
49+
A double click was performed on a cell in the listbox, on the given row/column.
50+
51+
If you start an modal dialog in this event, no normal DoublePressed event is sent to the instance.
52+
If you need an DoublePressed event in this situation return TRUE to raise a DoublePressed event.
53+
Default is false. The normal way is: Return allways false!!! See Notes in Class.
54+
```
55+
56+
**Event CellEditRequest(row as Integer, column as integer) As Boolean**
57+
58+
```
59+
The listbox wants to put an editable cell in inline edit mode on the given row/column.
60+
Return TRUE = Don't set this cell in EditMode
61+
Return FALSE = set this cell in Editmode (default)
62+
```
63+
64+
**Event CellSinglePressed(row as Integer, column as Integer)**
65+
66+
```
67+
A single click was performed on a cell in the listbox, on the given row/column.
68+
```
69+
70+
71+
72+
## Miscellaneous
73+
74+
- There is a flag in the class for debug purposes, if this is set to true, o lot of debug messages are written to the system log (fDebug). Default is false (OFF)
75+
- If you want these functions in your project, import the WTEC_CellTag and WTEC_DesktopListbox classes into your project (see releases).
76+
- I know that my English is far from perfect. I'm happy to accept corrections :-)
77+
78+
## History
79+
80+
| Date/Version | Remarks |
81+
| ------------ | ------------- |
82+
| 07.06.2023 | First Release |
83+
84+
85+

src/App.xojo_code

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
#tag Class
2+
Protected Class App
3+
Inherits DesktopApplication
4+
#tag Constant, Name = kEditClear, Type = String, Dynamic = False, Default = \"&Delete", Scope = Public
5+
#Tag Instance, Platform = Windows, Language = Default, Definition = \"&Delete"
6+
#Tag Instance, Platform = Linux, Language = Default, Definition = \"&Delete"
7+
#tag EndConstant
8+
9+
#tag Constant, Name = kFileQuit, Type = String, Dynamic = False, Default = \"&Quit", Scope = Public
10+
#Tag Instance, Platform = Windows, Language = Default, Definition = \"E&xit"
11+
#tag EndConstant
12+
13+
#tag Constant, Name = kFileQuitShortcut, Type = String, Dynamic = False, Default = \"", Scope = Public
14+
#Tag Instance, Platform = Mac OS, Language = Default, Definition = \"Cmd+Q"
15+
#Tag Instance, Platform = Linux, Language = Default, Definition = \"Ctrl+Q"
16+
#tag EndConstant
17+
18+
19+
#tag ViewBehavior
20+
#tag ViewProperty
21+
Name="Name"
22+
Visible=false
23+
Group="ID"
24+
InitialValue=""
25+
Type="String"
26+
EditorType=""
27+
#tag EndViewProperty
28+
#tag ViewProperty
29+
Name="Index"
30+
Visible=false
31+
Group="ID"
32+
InitialValue=""
33+
Type="Integer"
34+
EditorType=""
35+
#tag EndViewProperty
36+
#tag ViewProperty
37+
Name="Super"
38+
Visible=false
39+
Group="ID"
40+
InitialValue=""
41+
Type="String"
42+
EditorType=""
43+
#tag EndViewProperty
44+
#tag ViewProperty
45+
Name="Left"
46+
Visible=false
47+
Group="Position"
48+
InitialValue=""
49+
Type="Integer"
50+
EditorType=""
51+
#tag EndViewProperty
52+
#tag ViewProperty
53+
Name="Top"
54+
Visible=false
55+
Group="Position"
56+
InitialValue=""
57+
Type="Integer"
58+
EditorType=""
59+
#tag EndViewProperty
60+
#tag ViewProperty
61+
Name="AllowAutoQuit"
62+
Visible=false
63+
Group="Behavior"
64+
InitialValue=""
65+
Type="Boolean"
66+
EditorType=""
67+
#tag EndViewProperty
68+
#tag ViewProperty
69+
Name="AllowHiDPI"
70+
Visible=false
71+
Group="Behavior"
72+
InitialValue=""
73+
Type="Boolean"
74+
EditorType=""
75+
#tag EndViewProperty
76+
#tag ViewProperty
77+
Name="BugVersion"
78+
Visible=false
79+
Group="Behavior"
80+
InitialValue=""
81+
Type="Integer"
82+
EditorType=""
83+
#tag EndViewProperty
84+
#tag ViewProperty
85+
Name="Copyright"
86+
Visible=false
87+
Group="Behavior"
88+
InitialValue=""
89+
Type="String"
90+
EditorType="MultiLineEditor"
91+
#tag EndViewProperty
92+
#tag ViewProperty
93+
Name="Description"
94+
Visible=false
95+
Group="Behavior"
96+
InitialValue=""
97+
Type="String"
98+
EditorType="MultiLineEditor"
99+
#tag EndViewProperty
100+
#tag ViewProperty
101+
Name="LastWindowIndex"
102+
Visible=false
103+
Group="Behavior"
104+
InitialValue=""
105+
Type="Integer"
106+
EditorType=""
107+
#tag EndViewProperty
108+
#tag ViewProperty
109+
Name="MajorVersion"
110+
Visible=false
111+
Group="Behavior"
112+
InitialValue=""
113+
Type="Integer"
114+
EditorType=""
115+
#tag EndViewProperty
116+
#tag ViewProperty
117+
Name="MinorVersion"
118+
Visible=false
119+
Group="Behavior"
120+
InitialValue=""
121+
Type="Integer"
122+
EditorType=""
123+
#tag EndViewProperty
124+
#tag ViewProperty
125+
Name="NonReleaseVersion"
126+
Visible=false
127+
Group="Behavior"
128+
InitialValue=""
129+
Type="Integer"
130+
EditorType=""
131+
#tag EndViewProperty
132+
#tag ViewProperty
133+
Name="RegionCode"
134+
Visible=false
135+
Group="Behavior"
136+
InitialValue=""
137+
Type="Integer"
138+
EditorType=""
139+
#tag EndViewProperty
140+
#tag ViewProperty
141+
Name="StageCode"
142+
Visible=false
143+
Group="Behavior"
144+
InitialValue=""
145+
Type="Integer"
146+
EditorType=""
147+
#tag EndViewProperty
148+
#tag ViewProperty
149+
Name="Version"
150+
Visible=false
151+
Group="Behavior"
152+
InitialValue=""
153+
Type="string"
154+
EditorType="MultiLineEditor"
155+
#tag EndViewProperty
156+
#tag ViewProperty
157+
Name="_CurrentEventTime"
158+
Visible=false
159+
Group="Behavior"
160+
InitialValue=""
161+
Type="Integer"
162+
EditorType=""
163+
#tag EndViewProperty
164+
#tag EndViewBehavior
165+
End Class
166+
#tag EndClass

src/Build Automation.xojo_code

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#tag BuildAutomation
2+
Begin BuildStepList Linux
3+
Begin BuildProjectStep Build
4+
End
5+
End
6+
Begin BuildStepList Mac OS X
7+
Begin BuildProjectStep Build
8+
End
9+
Begin SignProjectStep Sign
10+
DeveloperID=
11+
End
12+
End
13+
Begin BuildStepList Windows
14+
Begin BuildProjectStep Build
15+
End
16+
End
17+
#tag EndBuildAutomation

0 commit comments

Comments
 (0)