Code: Select all
Let>PERCENT=%
Let>BORDER_WIDTH=5px
Let>BORDER_COLOR=limegreen
Let>BACKUP_BORDER_COLOR=BORDER_COLOR
Let>TEXT_COLOR=white
Let>BACKGROUND_COLOR=black
Let>BUTTON_WIDTH=300
Let>BUTTON_HEIGHT=50
Let>WIN_USEHANDLE=1
Let>END_OF_CODE=*/
Dialog>MAIN_DIALOG
object MAIN_DIALOG: TForm
BorderStyle = bsNone
ClientHeight = 200
ClientWidth = 175
Color = clLime
TransparentColor = True
TransparentColorValue = clLime
object BUTTON_1: tMSHTMLViewer
Left = -10
Top = -5
Height = 1
Width = 1
DefBackground = clLime
Cursor = crHandPoint
end
object BUTTON_2: tMSHTMLViewer
Left = -10
Top = 45
Height = 1
Width = 1
DefBackground = clLime
Cursor = crHandPoint
end
end
EndDialog>MAIN_DIALOG
GoSub>SETUP_BUTTON,{"1"},{"close"},{"Terminate"},{"CLOSE_APP"}
GoSub>SETUP_BUTTON,{"2"},{"message"},{"Hello!"},{"SEND_MESSAGE"}
Show>MAIN_DIALOG
Label>MainLoopStart
If>SHOULD_I_CLOSE=True
CloseDialog>MAIN_DIALOG
Wait>0.5
Exit>
Endif>
Wait>0.05
GoSub>CHECK_HOVERED_OBJECTS
Goto>MainLoopStart
SRT>CHECK_HOVERED_OBJECTS
Timer>CURRENT_timer
Let>k=0
Repeat>k
Let>k=k+1
If>BUTTON_%k%_HOVERED=True
Let>TIMER_diff=CURRENT_timer-TIMER_%k%
If>TIMER_diff>50
GetCursorPos>MOUSE_x,MOUSE_y
Let>TEMP_x_min=BUTTON_%k%_X_min
Let>TEMP_Y_min=BUTTON_%k%_Y_min
Let>TEMP_x_max=BUTTON_%k%_X_max
Let>TEMP_Y_max=BUTTON_%k%_Y_max
IfNot>{(%MOUSE_x% > %TEMP_x_min%) AND (%MOUSE_x% < %TEMP_x_max%) AND (%MOUSE_y% > %TEMP_y_min%) AND (%MOUSE_y% < %TEMP_y_max%)}
Let>BORDER_COLOR=BACKUP_BORDER_COLOR
Let>TEMP_icon=BUTTON_%k%_ICON
Let>TEMP_text=BUTTON_%k%_TEXT
LabelToVar>HTML_CODE_simple_button,TEMP_html,0,0,END_OF_CODE
SetDialogProperty>MAIN_DIALOG,BUTTON_%k%,HTML,TEMP_html
Let>BUTTON_%k%_HOVERED=False
Endif>
Endif>
Endif>
Until>k=2
END>CHECK_HOVERED_OBJECTS
SRT>UPDATE_TIMER
If>BUTTON_%UPDATE_TIMER_Var_1%_HOVERED=False
Timer>CURRENT_timer
Let>TIMER_%UPDATE_TIMER_Var_1%=CURRENT_timer
Let>BUTTON_%UPDATE_TIMER_Var_1%_HOVERED=True
Let>BORDER_COLOR=TEXT_COLOR
Let>TEMP_icon=BUTTON_%UPDATE_TIMER_Var_1%_ICON
Let>TEMP_text=BUTTON_%UPDATE_TIMER_Var_1%_TEXT
LabelToVar>HTML_CODE_simple_button,TEMP_html,0,0,END_OF_CODE
SetDialogProperty>MAIN_DIALOG,BUTTON_%UPDATE_TIMER_Var_1%,HTML,TEMP_html
Endif>
END>UPDATE_TIMER
SRT>BUTTON_CLICKED
Let>BUTTON_LAST_CLICKED=BUTTON_CLICKED_Var_1
Let>SUB_ROUTINE=SUB_
ConCat>SUB_ROUTINE,%BUTTON_CLICKED_Var_2%
UpperCase>SUB_ROUTINE,SUB_ROUTINE
GoSub>%SUB_ROUTINE%,%BUTTON_CLICKED_Var_1%
END>BUTTON_CLICKED
SRT>SUB_CLOSE_APP
Let>SHOULD_I_CLOSE=True
END>SUB_CLOSE_APP
SRT>SUB_SEND_MESSAGE
Message>SUB_SEND_MESSAGE_Var_1
END>SUB_SEND_MESSAGE
SRT>SETUP_BUTTON
Let>TEMP_number=SETUP_BUTTON_Var_1
Let>BUTTON_%TEMP_number%_HOVERED=False
Let>TEMP_icon=SETUP_BUTTON_Var_2
Let>BUTTON_%TEMP_number%_ICON=TEMP_icon
Let>TEMP_text=SETUP_BUTTON_Var_3
Let>BUTTON_%TEMP_number%_TEXT=TEMP_text
Let>TEMP_sub_routine=SETUP_BUTTON_Var_4
LabelToVar>HTML_CODE_simple_button,TEMP_html,0,0,*/
SetDialogProperty>MAIN_DIALOG,BUTTON_%TEMP_number%,HTML,TEMP_html
SetDialogProperty>MAIN_DIALOG,BUTTON_%TEMP_number%,Width,BUTTON_WIDTH
SetDialogProperty>MAIN_DIALOG,BUTTON_%TEMP_number%,Height,BUTTON_HEIGHT
GetWindowPos>MAIN_DIALOG.BUTTON_%TEMP_number%.HANDLE,TEMP_x,TEMP_y
Let>BUTTON_%TEMP_number%_X_min=TEMP_x
Let>BUTTON_%TEMP_number%_Y_min=TEMP_y
GetWindowSize>MAIN_DIALOG.BUTTON_%TEMP_number%.HANDLE,TEMP_w,TEMP_h
Let>BUTTON_%TEMP_number%_W=TEMP_w
Let>BUTTON_%TEMP_number%_H=TEMP_h
Let>BUTTON_%TEMP_number%_X_max=BUTTON_%TEMP_number%_X_min+BUTTON_%TEMP_number%_W
Let>BUTTON_%TEMP_number%_Y_max=BUTTON_%TEMP_number%_Y_min+BUTTON_%TEMP_number%_H
IfNot>TEMP_sub_routine=
AddDialogHandler>MAIN_DIALOG,BUTTON_%TEMP_number%,OnMouseUp,BUTTON_CLICKED(%TEMP_number%,%TEMP_sub_routine%)
Endif>
AddDialogHandler>MAIN_DIALOG,BUTTON_%TEMP_number%,OnMouseMove,UPDATE_TIMER(%TEMP_number%)
END>SETUP_BUTTON
/*
HTML_CODE_simple_button:
<div style="
border-style: solid;
border-width: %BORDER_WIDTH%px;
border-color: %BORDER_COLOR%;
background: %BACKGROUND_COLOR%;
color: %TEXT_COLOR%;
overflow: hidden;
height: 35px;
width: 64.5%PERCENT%;
font-size: 22px;
font-family: Arial, Helvetica, sans-serif;
">
<img src="icon\%TEMP_icon%.png" style="width:25px;height:25px;margin-top:3px;margin-bottom:-25px;">
<div style="height:25px;"> %TEMP_text% </div>
</div>
*/