CLEO HELP How to move a dialog?

MalikeiraOPoder

Well-Known Member
Joined
Mar 16, 2019
Messages
65
Likes
2
Points
8
5
#1
I want to know how can i move a Dialog.Create with CheckBox

Example: When i press in this CheckBox, i can move my textdraw and when i uncheck it, my dialog stay where i wanna..
 

Parazitas

Well-Known Member
Joined
Jan 2, 2017
Messages
1,409
Likes
153
Points
78
Location
Lithuania
Website
ugbase.eu
15
#4
PHP:
{$CLEO .cs}
0000: NOP

REPEAT
   WAIT 0
UNTIL 0AFA:
                               
Dialog.Create([email protected], "Hack Pack ")
Dialog.SetRECT([email protected], [email protected], [email protected], 260, 150)
/// Dialog Background color
Dialog.SetBackgroundColor([email protected], -16777216)
/// Dialog check Box
Dialog.AddCheckBox([email protected], 1, "{FF0000}Test move dialog", 10, 10, 200, 20)
Dialog.AddButton([email protected], 5, "Close", 80, 110, 70, 20)
/// Dialog minimize off
Dialog.SetMinimized([email protected], 0)
/// Dialog CheckBox colors 
Dialog.SetCheckBoxColor([email protected], 1, -15952405)
/// Dialog set not visibile
Dialog.SetVisible([email protected],0)

0B34: "dialog" @ShowDialog

while true
   wait 0

if 0AAB: file_exists "CLEO\INI\Settings.ini"
then
   0AF0: [email protected] getint "Cleo\INI\Settings.ini" section "DialogPosition" key "Positionxy"
   0AF0: [email protected] getint "Cleo\INI\Settings.ini" section "DialogPosition" key "Positionz"
else
    //default postion
    [email protected] = 500
    [email protected] = 500
end
   if Dialog.IsVisible([email protected])
   then
       SAMP.ToggleCursor(1) 
       if 0B81: dialog [email protected] pop_event_to [email protected] control_id_to [email protected]
       then
           if and
               [email protected] == 1
               0B92: dialog [email protected] checkbox [email protected] is_checked
           then
               //move dialog
               Dialog.GetRECT([email protected], [email protected], [email protected], [email protected], [email protected])
               0B5E: get_cursor_pos [email protected] [email protected]
               000C: [email protected] -= [email protected]
               000C: [email protected] -= [email protected]
               while 8B81: dialog [email protected] pop_event_to $n control_id_to $n
                   wait 0
                   0B5E: get_cursor_pos [email protected] [email protected]
                   000A: [email protected] += [email protected]
                   000A: [email protected] += [email protected] 
                   Dialog.SetRECT([email protected], [email protected], [email protected], [email protected], [email protected])
               end
               //save position, will auto create file if doesn't exist
               Dialog.GetRECT([email protected], [email protected], [email protected], [email protected], [email protected])
               0AF1: write_int [email protected] to_ini_file "Cleo\INI\Settings.ini" section "DialogPosition" key "Positionxy"
               0AF1: write_int [email protected] to_ini_file "Cleo\INI\Settings.ini" section "DialogPosition" key "Positionz"
           end
           
           if and
               [email protected] == 5
               [email protected] == 257
           then
               Dialog.SetVisible([email protected],0)
               SAMP.ToggleCursor(0)
           end
       end
   end
end

:ShowDialog
Dialog.SetVisible([email protected], 1)
SAMP.ToggleCursor(1)
0B43:
 
Top