Skip to content

Commit

Permalink
Change label hyperlinks to buttons
Browse files Browse the repository at this point in the history
Label hyperlinks are a very handy and intuitive navigation aid, but they can cause problems when a database has a "Hyperlink Base" specified. Every time you click the navigation link, it opens a web page to the hyperlink base, even if you don't have any specific path defined. (This happens with text box links as well, but not in datasheet mode.) Changing these links to transparent command buttons with the CursorOnHover property allows us to simulate the same functionality without the actual hyperlink invocation when the hyperlink base is defined. (As it is on the testing database.)
  • Loading branch information
joyfullservice committed May 17, 2023
1 parent 562d93d commit 44ce3cd
Show file tree
Hide file tree
Showing 3 changed files with 265 additions and 136 deletions.
122 changes: 88 additions & 34 deletions Version Control.accda.src/forms/frmVCSConflict.bas
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ Begin Form
GridY =24
Width =12960
DatasheetFontHeight =11
ItemSuffix =47
Left =20761
Top =2250
Right =-29055
Bottom =13995
ItemSuffix =48
Left =-25575
Top =1500
Right =-5475
Bottom =14085
RecSrcDt = Begin
0x79e78b777268e540
End
Expand Down Expand Up @@ -648,7 +648,7 @@ Begin Form
LayoutCachedTop =240
LayoutCachedWidth =12360
LayoutCachedHeight =1140
TabIndex =3
TabIndex =5
End
Begin Label
OverlapFlags =215
Expand Down Expand Up @@ -779,45 +779,97 @@ Begin Form
End
End
End
Begin Label
Begin CommandButton
FontUnderline = NotDefault
TabStop = NotDefault
OverlapFlags =85
TextAlign =2
Left =960
Left =2280
Top =7680
Width =1080
Height =300
Name ="lblSkipAll"
Caption ="Skip All"
Width =1620
TabIndex =3
Name ="cmdOverwriteAll"
Caption ="Overwrite All"
OnClick ="[Event Procedure]"
HyperlinkAddress ="#"
VerticalAnchor =1
LayoutCachedLeft =960
LeftPadding =135
TopPadding =135
RightPadding =150
BottomPadding =150
HorizontalAnchor =1
BackStyle =0

CursorOnHover =1
LayoutCachedLeft =2280
LayoutCachedTop =7680
LayoutCachedWidth =2040
LayoutCachedHeight =7980
LayoutCachedWidth =3900
LayoutCachedHeight =8040
ForeThemeColorIndex =10
ForeTint =100.0
Gradient =0
BackColor =5324600
BackThemeColorIndex =-1
BackTint =100.0
OldBorderStyle =0
BorderColor =15321539
BorderThemeColorIndex =-1
BorderTint =100.0
HoverThemeColorIndex =10
HoverTint =100.0
PressedThemeColorIndex =10
PressedShade =100.0
HoverForeThemeColorIndex =10
HoverForeTint =100.0
PressedForeThemeColorIndex =10
PressedForeTint =100.0
WebImagePaddingLeft =9
WebImagePaddingTop =9
WebImagePaddingRight =10
WebImagePaddingBottom =10
End
Begin Label
Begin CommandButton
FontUnderline = NotDefault
TabStop = NotDefault
OverlapFlags =85
TextAlign =2
Left =2280
Left =960
Top =7680
Width =1620
Height =300
Name ="lblOverwriteAll"
Caption ="Overwrite All"
Width =1080
TabIndex =4
Name ="cmdSkipAll"
Caption ="Skip All"
OnClick ="[Event Procedure]"
HyperlinkAddress ="#"
VerticalAnchor =1
LayoutCachedLeft =2280
LeftPadding =135
TopPadding =135
RightPadding =150
BottomPadding =150
HorizontalAnchor =1
BackStyle =0

CursorOnHover =1
LayoutCachedLeft =960
LayoutCachedTop =7680
LayoutCachedWidth =3900
LayoutCachedHeight =7980
LayoutCachedWidth =2040
LayoutCachedHeight =8040
ForeThemeColorIndex =10
ForeTint =100.0
Gradient =0
BackColor =5324600
BackThemeColorIndex =-1
BackTint =100.0
OldBorderStyle =0
BorderColor =15321539
BorderThemeColorIndex =-1
BorderTint =100.0
HoverThemeColorIndex =10
HoverTint =100.0
PressedThemeColorIndex =10
PressedShade =100.0
HoverForeThemeColorIndex =10
HoverForeTint =100.0
PressedForeThemeColorIndex =10
PressedForeTint =100.0
WebImagePaddingLeft =9
WebImagePaddingTop =9
WebImagePaddingRight =10
WebImagePaddingBottom =10
End
End
End
Expand Down Expand Up @@ -921,26 +973,28 @@ End Sub


'---------------------------------------------------------------------------------------
' Procedure : lblOverwriteAll_Click
' Procedure : cmdOverwriteAll_Click
' Author : Adam Waller
' Date : 11/1/2021
' Purpose : Overwrite all items in the list
'---------------------------------------------------------------------------------------
'
Private Sub lblOverwriteAll_Click()
Private Sub cmdOverwriteAll_Click()
sfrmConflictList.SetFocus
CodeDb.Execute "update tblConflicts set Resolution=" & eResolveConflict.ercOverwrite, dbFailOnError
sfrmConflictList.Requery
End Sub


'---------------------------------------------------------------------------------------
' Procedure : lblSkipAll_Click
' Procedure : cmdSkipAll_Click
' Author : Adam Waller
' Date : 11/1/2021
' Purpose : Skip all items in the list
'---------------------------------------------------------------------------------------
'
Private Sub lblSkipAll_Click()
Private Sub cmdSkipAll_Click()
sfrmConflictList.SetFocus
CodeDb.Execute "update tblConflicts set Resolution=" & eResolveConflict.ercSkip, dbFailOnError
sfrmConflictList.Requery
End Sub
Expand Down
93 changes: 61 additions & 32 deletions Version Control.accda.src/forms/frmVCSMain.bas
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ Begin Form
GridY =24
Width =9360
DatasheetFontHeight =11
ItemSuffix =32
Left =20761
Top =2250
Right =-29055
Bottom =13995
ItemSuffix =33
Left =-25575
Top =1500
Right =-5475
Bottom =14085
OnUnload ="[Event Procedure]"
RecSrcDt = Begin
0x79e78b777268e540
Expand Down Expand Up @@ -1583,29 +1583,6 @@ Begin Form
LayoutCachedWidth =6240
LayoutCachedHeight =6300
End
Begin Label
Visible = NotDefault
FontUnderline = NotDefault
OverlapFlags =215
Left =3120
Top =5640
Width =1320
Height =240
FontSize =10
Name ="lblOpenLogFile"
Caption ="Open Log File..."
OnClick ="[Event Procedure]"
HyperlinkAddress ="#"
LayoutCachedLeft =3120
LayoutCachedTop =5640
LayoutCachedWidth =4440
LayoutCachedHeight =5880
BorderThemeColorIndex =1
BorderTint =100.0
BorderShade =65.0
ForeThemeColorIndex =10
ForeTint =100.0
End
Begin Line
Visible = NotDefault
OverlapFlags =95
Expand Down Expand Up @@ -1713,6 +1690,57 @@ Begin Form
ThemeFontIndex =-1
ForeTint =100.0
End
Begin CommandButton
Visible = NotDefault
FontUnderline = NotDefault
TabStop = NotDefault
OverlapFlags =215
Left =3120
Top =5640
Width =1860
Height =240
FontSize =10
TabIndex =9
Name ="cmdOpenLogFile"
Caption ="Open Log File..."
OnClick ="[Event Procedure]"
LeftPadding =135
TopPadding =135
RightPadding =150
BottomPadding =150
HorizontalAnchor =1
BackStyle =0

CursorOnHover =1
LayoutCachedLeft =3120
LayoutCachedTop =5640
LayoutCachedWidth =4980
LayoutCachedHeight =5880
Alignment =1
ForeThemeColorIndex =10
ForeTint =100.0
Gradient =0
BackColor =5324600
BackThemeColorIndex =-1
BackTint =100.0
OldBorderStyle =0
BorderColor =15321539
BorderThemeColorIndex =-1
BorderTint =100.0
HoverThemeColorIndex =10
HoverTint =100.0
PressedThemeColorIndex =10
PressedShade =100.0
HoverForeThemeColorIndex =10
HoverForeTint =100.0
PressedForeThemeColorIndex =10
PressedForeTint =100.0
WebImagePaddingLeft =9
WebImagePaddingTop =9
WebImagePaddingRight =10
WebImagePaddingBottom =10
Overlaps =1
End
End
End
End
Expand Down Expand Up @@ -1876,7 +1904,7 @@ Public Sub FinishBuild(blnFullBuild As Boolean) 'Optional strType As String = "B
strType = IIf(blnFullBuild, "Build", "Merge")
SetStatusText "Finished", strType & " Complete", _
"Additional details can be found in the project " & LCase(strType) & " log file.<br><br>You may now close this window."
lblOpenLogFile.Visible = (Log.LogFilePath <> vbNullString)
cmdOpenLogFile.Visible = (Log.LogFilePath <> vbNullString)
Me.strLastLogFilePath = Log.LogFilePath

End Sub
Expand Down Expand Up @@ -1951,7 +1979,7 @@ Public Sub cmdExport_Click()
If FormLoaded(Me) Then
SetStatusText "Finished", "Export Complete", _
"Additional details can be found in the project export log file.<br><br>You may now close this window."
lblOpenLogFile.Visible = (Me.strLastLogFilePath <> vbNullString)
cmdOpenLogFile.Visible = (Me.strLastLogFilePath <> vbNullString)
Me.strLastLogFilePath = Me.strLastLogFilePath
DoEvents
End If
Expand Down Expand Up @@ -2139,13 +2167,14 @@ End Sub


'---------------------------------------------------------------------------------------
' Procedure : lblOpenLogFile_Click
' Procedure : cmdOpenLogFile_Click
' Author : Adam Waller
' Date : 11/6/2020
' Purpose : Open the log file
'---------------------------------------------------------------------------------------
'
Private Sub lblOpenLogFile_Click()
Private Sub cmdOpenLogFile_Click()
cmdClose.SetFocus
If FSO.FileExists(strLastLogFilePath) Then
' (Note, parentheses are required for the path argument)
CreateObject("Shell.Application").Open (strLastLogFilePath)
Expand Down
Loading

0 comments on commit 44ce3cd

Please sign in to comment.