Gambas France BETA


Pas de compte ? Incription

ReCase...De l'ordre dans ses Medias

À propos de ce code

Bonsoir à Tous.

Un début d'accessoire pour,
renommer en masse, ses Médias.

@+.
Reivillo.

Code source

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
' Gambas class file

PUBLIC hTrigger AS NEW Timer AS "_hTrigger"
PUBLIC iPos AS INTEGER
PUBLIC sPos AS STRING
PUBLIC btnTag AS BYTE = 1
PUBLIC blTag AS BOOLEAN = FALSE
PUBLIC iIndexFile AS INTEGER
PUBLIC sUnderFile AS STRING
PUBLIC sNameFile AS String[]

PUBLIC SUB Form_Open()

ME.Center
ME.W = 850
ME.Y = 0

END

PUBLIC SUB TextArea2_dblclick()

blTag = NOT blTag
hTrigger.Trigger

END

PUBLIC SUB _hTrigger_Timer()

IF NOT (btnTag = 3) THEN
TextArea2.Cut
sPos = Clipboard.Paste()
ENDIF
SELECT CASE btnTag
CASE 1
'-------------Inverse la Case du 1er Caractère du Mot--------------------
sPos = Chr$(Asc(Mid$(sPos, 1, 1)) XOR 32) & (Mid$(sPos, 2, Len(sPos)))
CASE 2
'-------------Tous les Caractères du Mot en Majuscule ou Minuscule-------------
IF blTag = TRUE THEN
sPos = (UCase$(sPos))
ELSE
sPos = (LCase$(sPos))
ENDIF
CASE 3
'-------------Tous les Caractères du Texte en Majuscule ou Minuscule-------------
IF blTag = TRUE THEN
TextArea2.text = (UCase$(TextArea2.text))
ELSE
TextArea2.text = (LCase$(TextArea2.text))
ENDIF
RETURN
END SELECT
Clipboard.Copy(sPos)
TextArea2.insert(clipboard.paste())

END

PUBLIC SUB Button1_Click()

IF Dialog.SelectDirectory() THEN RETURN
TextBox1.Text = Dialog.Path & "/"
_Load

END

PUBLIC SUB Button2_Click()

TextArea2.Text = Replace$(TextArea2.Text, Replace$(TextBox2.Text, "\"", ""), Replace$(TextBox3.Text, "\"", ""))

END

PUBLIC SUB Button3_Click()

DIM sNewNameFile AS String[]

iIndexFile = 0
sNewNameFile = Split(TextArea2.Text, Chr$(10), "", TRUE)
IF (sNewNameFile.Count <> sNameFile.Count) THEN RETURN
WHILE iIndexFile < sNameFile.Count
TRY MOVE TextBox1.Text & sNameFile[iIndexFile] TO TextBox1.text & sNewNameFile[iIndexFile]
INC iIndexFile
WEND
_Load

END

PUBLIC SUB RadioButton_MouseDown()

btnTag = LAST.tag

END

PUBLIC SUB _Load()

TextArea1.Text = ""
TextArea2.Text = TextArea1.Text
iIndexFile = 0
sNameFile = Dir(TextBox1.Text, "*").Sort()
WHILE iIndexFile < sNameFile.Count
sUnderFile = sNameFile[iIndexFile]
TextArea1.Text = TextArea1.Text & sUnderFile & Chr$(10)
INC iIndexFile
WEND
TextArea2.Text = TextArea1.Text
Button3.Enabled = TRUE

END

Commentaires