Commit 4226f329 authored by Benoît Minisini's avatar Benoît Minisini

Translation dialog: Add two buttons to move between translated strings and...

Translation dialog: Add two buttons to move between translated strings and redesign the dialog a bit.

[DEVELOPMENT ENVIRONMENT]
* NEW: Translation dialog: Move the current translation related buttons to their own toolbars juste above the translation field.
* NEW: Translation dialog: Add two buttons to move between translated strings.
parent efee886d
This diff is collapsed.
This diff is collapsed.
......@@ -702,24 +702,36 @@ Public Sub txtTranslate_KeyPress()
If Key.Alt Then
With cvwTranslate
If Key.Code = Key["Up"] Then
.MoveTo(.Key)
.MoveAbove()
If .Available Then
.Item.Selected = True
.Item.EnsureVisible()
If Key.Shift Then
If btnPreviousTranslated.Enabled Then btnPreviousTranslated_Click
Else If Key.Control Then
If btnPreviousUntranslated.Enabled Then btnPreviousUntranslated_Click
Else
.MoveTo(.Key)
.MoveAbove()
If .Available Then
.Item.Selected = True
.Item.EnsureVisible()
Endif
Endif
Else If Key.Code = Key["Down"] Then
.MoveTo(.Key)
.MoveBelow()
If .Available Then
.Item.Selected = True
.Item.EnsureVisible()
If Key.Shift Then
If btnNextTranslated.Enabled Then btnNextTranslated_Click
Else If Key.Control Then
If btnNextUntranslated.Enabled Then btnNextUntranslated_Click
Else
.MoveTo(.Key)
.MoveBelow()
If .Available Then
.Item.Selected = True
.Item.EnsureVisible()
Endif
Endif
Endif
End With
Else If Key.Shift Then
If Key.Code = Key.F4 Then
btnPrevious_Click()
btnPreviousUntranslated_Click()
Endif
Else If Key.Control Then
If Key.Code = Key["F"] Then
......@@ -730,7 +742,7 @@ Public Sub txtTranslate_KeyPress()
Case Key.F3
txtFind_Click
Case Key.F4
btnNext_Click
btnNextUntranslated_Click
Case Key.F5
btnCopy_Click
Case Key.F6
......@@ -1116,8 +1128,11 @@ Private Sub DisplayTrans()
Else
lblInfo.Text = Subst(("&1 strings. &2 are not translated. &3% done."), cvwTranslate.Count, nNotTrans, ($nTrans * 100) \ cvwTranslateOrg.Count)
Endif
btnNext.Enabled = cvwTranslate.Count - $nTrans
btnPrevious.Enabled = btnNext.Enabled
btnNextUntranslated.Enabled = cvwTranslate.Count - $nTrans
btnPreviousUntranslated.Enabled = btnNextUntranslated.Enabled
btnNextTranslated.Enabled = $nTrans > 0
btnPreviousTranslated.Enabled = btnNextTranslated.Enabled
End
......@@ -1167,7 +1182,7 @@ Private Sub ResizeTable()
End
Public Sub btnNext_Click()
Public Sub btnNextUntranslated_Click()
Dim sKey As String
......@@ -1197,7 +1212,7 @@ Public Sub btnNext_Click()
End
Public Sub btnPrevious_Click()
Public Sub btnPreviousUntranslated_Click()
Dim sKey As String
......@@ -1529,3 +1544,64 @@ Public Sub Form_Arrange()
ResizeTable
End
Public Sub btnNextTranslated_Click()
Dim sKey As String
With cvwTranslate
sKey = .Key
.MoveCurrent()
Do
.MoveBelow()
If Not .Available Then
.MoveFirst()
Endif
If .Item[1] Then
.Item.EnsureVisible
.Item.Selected = True
Return
Endif
If .Item.Key = sKey Then Return
Loop
End With
End
Public Sub btnPreviousTranslated_Click()
Dim sKey As String
With cvwTranslate
sKey = .Key
.MoveCurrent()
Do
.MoveAbove()
If Not .Available Then
.MoveLast()
Endif
If .Item[1] Then
.Item.EnsureVisible
.Item.Selected = True
Return
Endif
If .Item.Key = sKey Then Return
Loop
End With
End
......@@ -59,11 +59,11 @@
Index = 0
Text = ("Translation")
{ panTranslate VBox
MoveScaled(1,1,96,6)
MoveScaled(1,1,105,6)
Spacing = True
Margin = True
{ HBox2 HBox
MoveScaled(1,0,82,4)
MoveScaled(1,0,102,4)
{ btnMenu MenuButton
MoveScaled(0,0,6,4)
AutoResize = True
......@@ -73,23 +73,39 @@
MenuOnly = True
}
{ cmbLangSource ComboBox
MoveScaled(17,0,21,4)
MoveScaled(6,0,21,4)
Expand = True
ReadOnly = True
Sorted = True
}
{ PictureBox2 PictureBox
MoveScaled(39,0,4,4)
MoveScaled(28,0,4,4)
Picture = Picture["icon:/small/right"]
Alignment = Align.Center
}
{ cmbLang ComboBox
MoveScaled(45,0,18,4)
MoveScaled(33,0,18,4)
Font = Font["Bold"]
Expand = True
ReadOnly = True
Sorted = True
}
{ Panel8 Panel
MoveScaled(55,0,3,4)
}
{ Label1 Label
MoveScaled(63,0,7,4)
AutoResize = True
Text = ("Show")
}
{ Panel9 Panel
MoveScaled(72,0,1,4)
}
{ cmbFileChoice ComboBox
MoveScaled(76,0,24,4)
Expand = True
ReadOnly = True
}
}
}
{ Separator6 Separator
......@@ -102,50 +118,29 @@
ToolTip = ("Save translation")
Picture = Picture["icon:/small/save"]
}
{ btnClear ToolButton
MoveScaled(4,0,4,4)
ToolTip = ("Clear this translation")
Picture = Picture["icon:/small/clear"]
}
{ btnDoNotTranslate ToolButton
MoveScaled(10,0,4,4)
ToolTip = ("This string must not be translated")
Picture = Picture["icon:/small/warning"]
}
{ btnCopy ToolButton
MoveScaled(14,0,4,4)
ToolTip = ("Copy untranslated string")
Picture = Picture["icon:/small/paste"]
}
{ btnVerify ToolButton
MoveScaled(18,0,4,4)
MoveScaled(5,0,4,4)
ToolTip = ("Verify the translation")
Picture = Picture["icon:/small/watch"]
Picture = Picture["icon:/small/wizard"]
}
{ btnNext ToolButton
MoveScaled(22,0,4,4)
ToolTip = ("Find next untranslated string")
{ btnNextTranslated ToolButton
MoveScaled(10,0,4,4)
ToolTip = ("Find next translated string")
Picture = Picture["icon:/small/down"]
}
{ btnPrevious ToolButton
MoveScaled(26,0,4,4)
ToolTip = ("Find previous untranslated string")
{ btnPreviousTranslated ToolButton
MoveScaled(14,0,4,4)
ToolTip = ("Find previous translated string")
Picture = Picture["icon:/small/up"]
}
{ Panel2 Panel
MoveScaled(31,0,1,4)
{ Separator7 Separator
MoveScaled(25,0,0,4)
}
{ txtFind ButtonBox
MoveScaled(33,0,16,4)
Expand = True
Picture = Picture["icon:/16/find"]
}
{ Panel6 Panel
MoveScaled(51,0,1,4)
}
{ cmbFileChoice ComboBox
MoveScaled(56,0,34,4)
ReadOnly = True
Border = False
}
}
{ Separator2 Separator
......@@ -155,7 +150,7 @@
MoveScaled(1,17,98,44)
Expand = True
{ cvwTranslate ColumnView
MoveScaled(7,2,70,18)
MoveScaled(7,2,70,8)
Expand = True
Sorted = True
Header = False
......@@ -164,7 +159,7 @@
ScrollBar = Scroll.Vertical
}
{ VBox2 VBox
MoveScaled(3,21,85,21)
MoveScaled(3,15,85,28)
Expand = True
{ panComment HBox
MoveScaled(7,0,11,4)
......@@ -188,8 +183,39 @@
{ Separator5 Separator
MoveScaled(3,13,15,0)
}
{ HBox1 HBox
MoveScaled(2,15,43,4)
{ btnClear ToolButton
MoveScaled(0,0,4,4)
ToolTip = ("Clear this translation")
Picture = Picture["icon:/small/clear"]
}
{ btnDoNotTranslate ToolButton
MoveScaled(6,0,4,4)
ToolTip = ("This string must not be translated")
Picture = Picture["icon:/small/warning"]
}
{ btnCopy ToolButton
MoveScaled(10,0,4,4)
ToolTip = ("Copy untranslated string")
Picture = Picture["icon:/small/paste"]
}
{ btnNextUntranslated ToolButton
MoveScaled(18,0,4,4)
ToolTip = ("Find next untranslated string")
Picture = Picture["icon:/small/rewind"]
}
{ btnPreviousUntranslated ToolButton
MoveScaled(22,0,4,4)
ToolTip = ("Find previous untranslated string")
Picture = Picture["icon:/small/forward"]
}
}
{ Separator8 Separator
MoveScaled(1,20,15,0)
}
{ Panel1 Panel
MoveScaled(1,14,40,6)
MoveScaled(1,21,40,6)
Background = Color.TextBackground
Expand = True
Arrangement = Arrange.Fill
......@@ -213,8 +239,8 @@
Margin = True
{ PictureBox3 PictureBox
MoveScaled(0,0,4,4)
Picture = Picture["icon:/medium/info"]
AutoResize = True
Picture = Picture["icon:/medium/info"]
Alignment = Align.Center
}
{ lblInfo Label
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment