Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Add None border option
  • Loading branch information
chunmingwang authored Nov 30, 2023
1 parent 59ffdd0 commit 458087a
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 29 deletions.
2 changes: 1 addition & 1 deletion ChineseCalendar.vfp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ OpenProjectAsFolder=false
MajorVersion=0
MinorVersion=0
RevisionVersion=0
BuildVersion=1527
BuildVersion=1552
AutoIncrementVersion=false
ApplicationTitle="Chinese Calendar"
ApplicationIcon=""
Expand Down
4 changes: 2 additions & 2 deletions Clock.rc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#define APP_TITLE_STR "Chinese Calendar\0"
#define VER_FILEDESCRIPTION_STR "\0"

#define VER_FILEVERSION 0,0,0,1527
#define VER_FILEVERSION_STR "0.0.0.1527\0"
#define VER_FILEVERSION 0,0,0,1552
#define VER_FILEVERSION_STR "0.0.0.1552\0"

#define VER_LEGALCOPYRIGHT_STR "Cm.Wang\0"

Expand Down
74 changes: 51 additions & 23 deletions frmClock.frm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
Dim As TimerComponent TimerComponent1, TimerComponent2
Dim As Panel Picture1
Dim As PopupMenu PopupMenu1
Dim As MenuItem mnuAlwaysOnTop, mnuClickThrough, mnuAutoStart, mnuTransparent, mnuBar1, mnuArrange, mnuDayCalendar, mnuMonthCalendar, mnuBar2, mnuAbout, mnuBar3, mnuExit, mnuClose, mnuHide, mnuBlinkColon, mnuShowSec, mnuShowCaption
Dim As MenuItem mnuAlwaysOnTop, mnuClickThrough, mnuAutoStart, mnuTransparent, mnuBar1, mnuArrange, mnuDayCalendar, mnuMonthCalendar, mnuBar2, mnuAbout, mnuBar3, mnuExit, mnuClose, mnuHide, mnuBlinkColon, mnuShowSec, mnuHideCaption, mnuNoneBorder
End Type

Constructor frmClockType
Expand All @@ -57,16 +57,16 @@
.Font.Name = "Consolas"
.Font.Size = 12
.Font.Bold = True
.BorderStyle = FormBorderStyle.Sizable
.StartPosition = FormStartPosition.CenterScreen
.Location = Type<My.Sys.Drawing.Point>(0, 0)
.Size = Type<My.Sys.Drawing.Size>(330, 130)
.ContextMenu = @PopupMenu1
.OnCreate = Cast(Sub(ByRef Designer As My.Sys.Object, ByRef Sender As Control), @Form_Create)
.OnDestroy = Cast(Sub(ByRef Designer As My.Sys.Object, ByRef Sender As Control), @Form_Destroy)
.OnMessage = Cast(Sub(ByRef Designer As My.Sys.Object, ByRef Sender As Control, ByRef Msg As Message), @Form_Message)
.Icon = "1"
.OnMouseMove = Cast(Sub(ByRef Designer As My.Sys.Object, ByRef Sender As Control, MouseButton As Integer, x As Integer, y As Integer, Shift As Integer), @Form_MouseMove)
.Opacity = 254
.Icon = "1"
.SetBounds 0, 0, 330, 140
End With
' TimerComponent1
Expand Down Expand Up @@ -141,6 +141,15 @@
.OnClick = Cast(Sub(ByRef Designer As My.Sys.Object, ByRef Sender As MenuItem), @mnu_Click)
.Parent = @PopupMenu1
End With
' mnuBlinkColon
With mnuBlinkColon
.Name = "mnuBlinkColon"
.Designer = @This
.Caption = "Blink colon"
.Checked = True
.OnClick = Cast(Sub(ByRef Designer As My.Sys.Object, ByRef Sender As MenuItem), @mnu_Click)
.Parent = @PopupMenu1
End With
' mnuShowSec
With mnuShowSec
.Name = "mnuShowSec"
Expand All @@ -150,21 +159,19 @@
.OnClick = Cast(Sub(ByRef Designer As My.Sys.Object, ByRef Sender As MenuItem), @mnu_Click)
.Parent = @PopupMenu1
End With
' mnuShowCaption
With mnuShowCaption
.Name = "mnuShowCaption"
' mnuHideCaption
With mnuHideCaption
.Name = "mnuHideCaption"
.Designer = @This
.Caption = "Show caption"
.Checked = True
.Caption = "Hide caption"
.OnClick = Cast(Sub(ByRef Designer As My.Sys.Object, ByRef Sender As MenuItem), @mnu_Click)
.Parent = @PopupMenu1
End With
' mnuBlinkColon
With mnuBlinkColon
.Name = "mnuBlinkColon"
' mnuNoneBorder
With mnuNoneBorder
.Name = "mnuNoneBorder"
.Designer = @This
.Caption = "Blink colon"
.Checked = True
.Caption = "None border"
.OnClick = Cast(Sub(ByRef Designer As My.Sys.Object, ByRef Sender As MenuItem), @mnu_Click)
.Parent = @PopupMenu1
End With
Expand Down Expand Up @@ -375,22 +382,26 @@ Private Sub frmClockType.mnu_Click(ByRef Sender As MenuItem)
Sender.Checked = True
End If
Opacity = IIf(Sender.Checked = True, 127, 255)
frmDayCalendar.Opacity = IIf(Sender.Checked = True, 127, 255)
frmMonthCalendar.Opacity = IIf(Sender.Checked = True, 127, 255)
Case "mnuShowCaption"
frmDayCalendar.Opacity = Opacity
frmMonthCalendar.Opacity = Opacity
Case "mnuNoneBorder"
If Sender.Checked Then
Sender.Checked = False
Else
Sender.Checked = True
End If
Dim style As Long = GetWindowLong(Handle, GWL_STYLE)
BorderStyle = IIf(Sender.Checked, FormBorderStyle.None, FormBorderStyle.Sizable)
frmDayCalendar.BorderStyle = BorderStyle
frmMonthCalendar.BorderStyle = BorderStyle
Case "mnuHideCaption"
If Sender.Checked Then
style = style Or WS_CAPTION
Sender.Checked = False
Else
style = style Xor WS_CAPTION
Sender.Checked = True
End If
SetWindowLong(Handle, GWL_STYLE, style)
SetWindowPos(Handle, NULL, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE Or SWP_NOZORDER Or SWP_FRAMECHANGED)
HideCaption = Sender.Checked
frmDayCalendar.HideCaption = HideCaption
frmMonthCalendar.HideCaption = HideCaption
Case "mnuShowSec"
If Sender.Checked Then
Sender.Checked = False
Expand All @@ -410,15 +421,30 @@ Private Sub frmClockType.mnu_Click(ByRef Sender As MenuItem)
If mnuDayCalendar.Checked Then frmDayCalendar.Visible = This.Visible
If mnuMonthCalendar.Checked Then frmMonthCalendar.Visible = This.Visible
Case "mnuArrange"
If mnuDayCalendar.Checked Then frmDayCalendar.Move Left, Top + Height, Width, Height * 2
If mnuMonthCalendar.Checked Then frmMonthCalendar.Move frmDayCalendar.Left, frmDayCalendar.Top + frmDayCalendar.Height, Width, Height * 2
If frmDayCalendar.Handle Then
frmDayCalendar.Move Left, Top + Height, Width, Height * 1.8
If frmMonthCalendar.Handle Then
frmMonthCalendar.Move frmDayCalendar.Left, frmDayCalendar.Top + frmDayCalendar.Height, Width, Height * 1.8
Else
Print "frmMonthCalendar"
End If
Else
Print "frmDayCalendar"
If frmMonthCalendar.Handle Then
frmMonthCalendar.Move Left, Top + Height, Width, Height * 1.8
Else
Print "frmMonthCalendar"
End If
End If
Case "mnuDayCalendar"
If Sender.Checked Then
frmDayCalendar.CloseForm
Sender.Checked = False
Else
frmDayCalendar.Show(frmClock)
frmDayCalendar.Visible = mnuHide.Checked = False
frmDayCalendar.HideCaption = HideCaption
frmDayCalendar.BorderStyle = BorderStyle
Sender.Checked = True
End If
Case "mnuMonthCalendar"
Expand All @@ -428,6 +454,8 @@ Private Sub frmClockType.mnu_Click(ByRef Sender As MenuItem)
Else
frmMonthCalendar.Show(frmClock)
frmMonthCalendar.Visible = mnuHide.Checked = False
frmMonthCalendar.HideCaption = HideCaption
frmMonthCalendar.BorderStyle = BorderStyle
Sender.Checked = True
End If
Case "mnuClose"
Expand Down
2 changes: 1 addition & 1 deletion frmDayCalendar.frm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#endif
.Designer = @This
.Size = Type<My.Sys.Drawing.Size>(330, 250)
.Opacity = 250
.Opacity = 254
.OnClose = Cast(Sub(ByRef Designer As My.Sys.Object, ByRef Sender As Form, ByRef Action As Integer), @Form_Close)
.Icon = "2"
.OnMouseMove = Cast(Sub(ByRef Designer As My.Sys.Object, ByRef Sender As Control, MouseButton As Integer, x As Integer, y As Integer, Shift As Integer), @Form_MouseMove)
Expand Down
3 changes: 1 addition & 2 deletions frmMonthCalendar.frm
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,11 @@
.Designer = @This
.OnCreate = Cast(Sub(ByRef Designer As My.Sys.Object, ByRef Sender As Control), @Form_Create)
.Location = Type<My.Sys.Drawing.Point>(0, 0)
.StartPosition = FormStartPosition.DefaultLocation
.Size = Type<My.Sys.Drawing.Size>(330, 250)
.Opacity = 250
.OnClose = Cast(Sub(ByRef Designer As My.Sys.Object, ByRef Sender As Form, ByRef Action As Integer), @Form_Close)
.Icon = "3"
.SetBounds 0, 0, 330, 250
.SetBounds 0, 0, 330, 254
End With
' Panel1
With Panel1
Expand Down

0 comments on commit 458087a

Please sign in to comment.