mirror of
https://github.com/Rayerd/dfl.git
synced 2025-04-26 04:59:55 +03:00
Add StatusBar example code.
Fix copyright in some dub.json files.
This commit is contained in:
parent
457a1e76f4
commit
be5ce5ef60
10 changed files with 127 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"authors": ["haru-s"],
|
||||
"copyright": "Copyright (C) 2022 haru-s",
|
||||
"copyright": "Copyright (C) 2023 haru-s",
|
||||
"description": "DFL sample code.",
|
||||
"name": "buttons_example",
|
||||
"targetType": "executable",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"authors": ["haru-s"],
|
||||
"copyright": "Copyright (C) 2022 haru-s",
|
||||
"copyright": "Copyright (C) 2023 haru-s",
|
||||
"description": "DFL sample code.",
|
||||
"name": "label_sample",
|
||||
"targetType": "executable",
|
||||
|
|
16
examples/statusbar/.gitignore
vendored
Normal file
16
examples/statusbar/.gitignore
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
.dub
|
||||
docs.json
|
||||
__dummy.html
|
||||
docs/
|
||||
/hello_dfl
|
||||
hello_dfl.so
|
||||
hello_dfl.dylib
|
||||
hello_dfl.dll
|
||||
hello_dfl.a
|
||||
hello_dfl.lib
|
||||
hello_dfl-test-*
|
||||
*.exe
|
||||
*.pdb
|
||||
*.o
|
||||
*.obj
|
||||
*.lst
|
20
examples/statusbar/.vscode/tasks.json
vendored
Normal file
20
examples/statusbar/.vscode/tasks.json
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"type": "dub",
|
||||
"run": true,
|
||||
"cwd": ".",
|
||||
"compiler": "$current",
|
||||
"archType": "$current",
|
||||
"buildType": "$current",
|
||||
"configuration": "$current",
|
||||
"problemMatcher": [
|
||||
"$dmd"
|
||||
],
|
||||
"group": "build",
|
||||
"label": "dub: Build statusbar_sample",
|
||||
"detail": "dub build --compiler=dmd.EXE -a=x86_64 -b=debug -c=application"
|
||||
}
|
||||
]
|
||||
}
|
16
examples/statusbar/dub.json
Normal file
16
examples/statusbar/dub.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"authors": ["haru-s"],
|
||||
"copyright": "Copyright (C) 2023 haru-s",
|
||||
"description": "DFL sample code.",
|
||||
"name": "statusbar_sample",
|
||||
"targetType": "executable",
|
||||
"targetPath": "bin",
|
||||
"dependencies": {
|
||||
"dfl": {
|
||||
"path": "../../../dfl"
|
||||
}
|
||||
},
|
||||
"lflags-windows-x86_omf-dmd": ["/exet:nt/su:windows:6.0"],
|
||||
"lflags-windows-x86_mscoff-dmd": ["/SUBSYSTEM:WINDOWS", "/ENTRY:mainCRTStartup"],
|
||||
"lflags-windows-x86_64-dmd": ["/SUBSYSTEM:WINDOWS", "/ENTRY:mainCRTStartup"]
|
||||
}
|
7
examples/statusbar/dub.selections.json
Normal file
7
examples/statusbar/dub.selections.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"fileVersion": 1,
|
||||
"versions": {
|
||||
"dfl": {"path":"../.."},
|
||||
"undead": "1.1.8"
|
||||
}
|
||||
}
|
3
examples/statusbar/shell.bat
Normal file
3
examples/statusbar/shell.bat
Normal file
|
@ -0,0 +1,3 @@
|
|||
set dmd_path=c:\d\dmd2\windows
|
||||
set dmc_path=c:\dmc\dm
|
||||
cmd
|
50
examples/statusbar/source/statusbar_sample.d
Normal file
50
examples/statusbar/source/statusbar_sample.d
Normal file
|
@ -0,0 +1,50 @@
|
|||
import dfl;
|
||||
import std.conv;
|
||||
|
||||
version(Have_dfl) // For DUB.
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
pragma(lib, "dfl.lib");
|
||||
}
|
||||
|
||||
class MainForm : Form
|
||||
{
|
||||
private StatusBar _statusBar;
|
||||
|
||||
this()
|
||||
{
|
||||
this.text = "StatusBar example";
|
||||
this.size = Size(300, 300);
|
||||
|
||||
_statusBar = new StatusBar();
|
||||
|
||||
StatusBarPanel panel1 = new StatusBarPanel("Click count:");
|
||||
StatusBarPanel panel2 = new StatusBarPanel("Second panel");
|
||||
StatusBarPanel panel3 = new StatusBarPanel("Third panel");
|
||||
|
||||
panel1.borderStyle = StatusBarPanelBorderStyle.SUNKEN;
|
||||
panel2.borderStyle = StatusBarPanelBorderStyle.RAISED;
|
||||
panel3.borderStyle = StatusBarPanelBorderStyle.NONE;
|
||||
|
||||
panel1.width = 100;
|
||||
|
||||
_statusBar.panels.add(panel1);
|
||||
_statusBar.panels.add(panel2);
|
||||
_statusBar.panels.add(panel3);
|
||||
|
||||
_statusBar.showPanels = true;
|
||||
_statusBar.parent = this;
|
||||
|
||||
this.click ~= (Control c, EventArgs e) {
|
||||
static int counter;
|
||||
panel1.text = "Click count: " ~ to!string(++counter);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
Application.run(new MainForm());
|
||||
}
|
12
examples/statusbar/statusbar.code-workspace
Normal file
12
examples/statusbar/statusbar.code-workspace
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "."
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"d.projectImportPaths": [
|
||||
"..\\..\\..\\dfl\\source"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"authors": ["haru-s"],
|
||||
"copyright": "Copyright (C) 2022 haru-s",
|
||||
"copyright": "Copyright (C) 2023 haru-s",
|
||||
"description": "DFL sample code.",
|
||||
"name": "tabcontrol_sample",
|
||||
"targetType": "executable",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue