Use of package.d for cleaner import lines in applications.

This commit is contained in:
knommad 2015-02-22 09:13:53 +10:30
parent 5e59151661
commit 0d81aafee6
7 changed files with 12 additions and 12 deletions

View File

@ -217,7 +217,7 @@ Hello World
-------------------------------------------------------------- --------------------------------------------------------------
// myproject.d // myproject.d
import dlangui.all; import dlangui;
mixin APP_ENTRY_POINT; mixin APP_ENTRY_POINT;
/// entry point for dlangui based application /// entry point for dlangui based application
@ -239,10 +239,10 @@ Sample dub.json:
{ {
"name": "myproject", "name": "myproject",
"description": "sample DLangUI project", "description": "sample DLangUI project",
"targetPath": "bin", "targetPath": "bin",
"targetType": "executable", "targetType": "executable",
"dependencies": { "dependencies": {
"dlangui": "~master" "dlangui": "~master"
} }

View File

@ -15,7 +15,7 @@ Authors: Vadim Lopatin, coolreader.org@gmail.com
*/ */
module main; module main;
import dlangui.all; import dlangui;
import dlangui.dialogs.dialog; import dlangui.dialogs.dialog;
import dlangui.dialogs.filedlg; import dlangui.dialogs.filedlg;
import dlangui.dialogs.msgbox; import dlangui.dialogs.msgbox;

View File

@ -1,6 +1,6 @@
module app; module app;
import dlangui.all; import dlangui;
import std.stdio; import std.stdio;
import std.conv; import std.conv;
@ -11,7 +11,7 @@ mixin APP_ENTRY_POINT;
extern (C) int UIAppMain(string[] args) { extern (C) int UIAppMain(string[] args) {
// create window // create window
Window window = Platform.instance.createWindow("My Window", null); Window window = Platform.instance.createWindow("My Window", null);
// create some widget to show in window // create some widget to show in window
window.mainWidget = (new Button()).text("Hello world"d).margins(Rect(20,20,20,20)); window.mainWidget = (new Button()).text("Hello world"d).margins(Rect(20,20,20,20));

View File

@ -2,7 +2,7 @@ module gui;
import model; import model;
import dlangui.all; import dlangui;
/// game action codes /// game action codes
enum TetrisAction : int { enum TetrisAction : int {
@ -21,7 +21,7 @@ const Action ACTION_FAST_DOWN = (new Action(TetrisAction.FastDown, KeyCode.SP
const Action ACTION_PAUSE = (new Action(TetrisAction.Pause, KeyCode.ESCAPE)).addAccelerator(KeyCode.PAUSE).iconId("pause"); const Action ACTION_PAUSE = (new Action(TetrisAction.Pause, KeyCode.ESCAPE)).addAccelerator(KeyCode.PAUSE).iconId("pause");
const Action ACTION_LEVEL_UP = (new Action(TetrisAction.LevelUp, KeyCode.ADD)).addAccelerator(KeyCode.INS).iconId("levelup"); const Action ACTION_LEVEL_UP = (new Action(TetrisAction.LevelUp, KeyCode.ADD)).addAccelerator(KeyCode.INS).iconId("levelup");
const Action[] CUP_ACTIONS = [ACTION_PAUSE, ACTION_ROTATE, ACTION_LEVEL_UP, const Action[] CUP_ACTIONS = [ACTION_PAUSE, ACTION_ROTATE, ACTION_LEVEL_UP,
ACTION_MOVE_LEFT, ACTION_FAST_DOWN, ACTION_MOVE_RIGHT]; ACTION_MOVE_LEFT, ACTION_FAST_DOWN, ACTION_MOVE_RIGHT];
/// about dialog /// about dialog

View File

@ -15,7 +15,7 @@ Authors: Vadim Lopatin, coolreader.org@gmail.com
*/ */
module main; module main;
import dlangui.all; import dlangui;
import model; import model;
import gui; import gui;

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,7 @@ Synopsis:
---- ----
// helloworld // helloworld
import dlangui.all; import dlangui;
// required in one of modules // required in one of modules
mixin APP_ENTRY_POINT; mixin APP_ENTRY_POINT;
@ -44,7 +44,7 @@ Copyright: Vadim Lopatin, 2014
License: Boost License 1.0 License: Boost License 1.0
Authors: Vadim Lopatin, coolreader.org@gmail.com Authors: Vadim Lopatin, coolreader.org@gmail.com
*/ */
module dlangui.all; module dlangui;
public import dlangui.core.logger; public import dlangui.core.logger;
public import dlangui.core.types; public import dlangui.core.types;