| 1 |
import dabo |
|---|
| 2 |
dabo.ui.loadUI("wx") |
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
class WordWrapDialog(dabo.ui.dDialog): |
|---|
| 6 |
def addControls(self): |
|---|
| 7 |
sz = self.Sizer = dabo.ui.dSizer("h") |
|---|
| 8 |
sz.appendSpacer(25) |
|---|
| 9 |
|
|---|
| 10 |
txt = getGettyAddr() |
|---|
| 11 |
lbl = self.gettyLabel = dabo.ui.dLabel(self, Caption=txt, WordWrap=True) |
|---|
| 12 |
sz.append(lbl, 1, border=10) |
|---|
| 13 |
|
|---|
| 14 |
self.Caption = "WordWrap with dLabel doesn't get Height right on Mac/Win" |
|---|
| 15 |
self.Width = 640 |
|---|
| 16 |
self.Height = 480 |
|---|
| 17 |
self.layout() |
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
def getGettyAddr(): |
|---|
| 21 |
"""Return Lincoln's Gettysburg Address.""" |
|---|
| 22 |
return " ".join(["Four score and seven years ago our fathers brought", |
|---|
| 23 |
"forth on this continent a new nation, conceived in liberty and", |
|---|
| 24 |
"dedicated to the proposition that all men are created equal.", |
|---|
| 25 |
"Now we are engaged in a great civil war, testing whether that", |
|---|
| 26 |
"nation or any nation so conceived and so dedicated can long", |
|---|
| 27 |
"endure. We are met on a great battlefield of that war. We have", |
|---|
| 28 |
"come to dedicate a portion of that field as a final resting-place", |
|---|
| 29 |
"for those who here gave their lives that that nation might live.", |
|---|
| 30 |
"It is altogether fitting and proper that we should do this. But in", |
|---|
| 31 |
"a larger sense, we cannot dedicate, we cannot consecrate, we", |
|---|
| 32 |
"cannot hallow this ground. The brave men, living and dead", |
|---|
| 33 |
"who struggled here have consecrated it far above our poor", |
|---|
| 34 |
"power to add or detract. The world will little note nor long", |
|---|
| 35 |
"remember what we say here, but it can never forget what they", |
|---|
| 36 |
"did here. It is for us the living rather to be dedicated here to", |
|---|
| 37 |
"the unfinished work which they who fought here have thus far", |
|---|
| 38 |
"so nobly advanced. It is rather for us to be here dedicated to", |
|---|
| 39 |
"the great task remaining before us --that from these honored", |
|---|
| 40 |
"dead we take increased devotion to that cause for which they", |
|---|
| 41 |
"gave the last full measure of devotion-- that we here highly", |
|---|
| 42 |
"resolve that these dead shall not have died in vain, that this", |
|---|
| 43 |
"nation under God shall have a new birth of freedom, and that", |
|---|
| 44 |
"government of the people, by the people, for the people shall", |
|---|
| 45 |
"not perish from the earth."]) |
|---|
| 46 |
|
|---|
| 47 |
app = dabo.dApp(MainFormClass=None) |
|---|
| 48 |
app.setup() |
|---|
| 49 |
dlg = WordWrapDialog(None, BorderResizable=True, AutoSize=False, Centered=True) |
|---|
| 50 |
dlg.show() |
|---|