-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from clue-labs/text-dialog
Add abstract base for all textual dialogs + simple ctor
- Loading branch information
Showing
15 changed files
with
110 additions
and
116 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
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,46 @@ | ||
<?php | ||
|
||
namespace Clue\React\Zenity\Dialog; | ||
|
||
use Clue\React\Zenity\Dialog\AbstractDialog; | ||
|
||
/** | ||
* Abstract base class for all dialogs that support passing a text. | ||
* | ||
* For each type, use the --text option to specify the text that is displayed in the dialog. | ||
* The text is commonly printed as the main (or first) information in the dialog. | ||
* | ||
* Also inherits all properties and options from common AbstractDialog base. | ||
* | ||
* @see AbstractDialog | ||
*/ | ||
abstract class AbstractTextDialog extends AbstractDialog | ||
{ | ||
protected $text; | ||
|
||
/** | ||
* Construct new text dialog | ||
* | ||
* Passing a $text is optional. Most dialog types define a default text | ||
* as a fallback. Some dialog types leave out the text if non is passed. | ||
* | ||
* @param string|null $text (optional) main text displayed in the dialog. | ||
*/ | ||
public function __construct($text = null) | ||
{ | ||
$this->text = $text; | ||
} | ||
|
||
/** | ||
* Specifies the text that is displayed in the dialog. | ||
* | ||
* @param string $text | ||
* @return self chainable | ||
*/ | ||
public function setText($text) | ||
{ | ||
$this->text = $text; | ||
|
||
return $this; | ||
} | ||
} |
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
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
Oops, something went wrong.