Jump to content



HelloInsomnia

Member Since 10 Apr 2012
Offline Last Active Yesterday, 08:16 PM
*****

#140137 Ultimate Ui - Create Beautiful Uis With Xaml, Datagrid, Metro & More!

Posted by HelloInsomnia on 09 May 2020 - 09:27 PM

Edit: I had Metro on in the previous version (which would work too) - so this is for a normal button




#140133 Ultimate Ui - Create Beautiful Uis With Xaml, Datagrid, Metro & More!

Posted by HelloInsomnia on 09 May 2020 - 12:28 PM

Hi Nick,

 

Could you post some sample code on how to change UI buttons appearance on hover? I can set the buttons background color and border with something like:

<Border Padding="8">
     <Border.Resources>
        <Style TargetType="{x:Type Button}">
                <Setter Property="Background" Value="#181818" />
                <Setter Property="BorderBrush" Value="#181818" />
                <Setter Property="Foreground" Value="#B3B5B1" />
          </Style>
     </Border.Resources>
</Border>

However, when I add some code like:

<Style.Triggers>
   <Trigger Property="IsMouseOver" Value="True">
        <Setter Property="Background" Value="#FFF" />
        <Setter Property="BorderBrush"  Value="#FFF"/>
   </Trigger>
</Style.Triggers>

In between the <Style> tags it doesn't take effect - the default styling still applies to the hover state.

 

Could you point me in the right direction on how to customize WPF elements on different states (such as hover)?

 

Would be much appreciated. Thanks in advance!

 

Yes probably something like this:

 

<Grid>
        <Grid.Resources>
            <Style x:Key="FocusVisual">
                <Setter Property="Control.Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <SolidColorBrush x:Key="Button.Static.Background" Color="#FF181818"/>
            <SolidColorBrush x:Key="Button.Static.Border" Color="#FF181818"/>
            <SolidColorBrush x:Key="Button.MouseOver.Background" Color="#FFFFFFFF"/>
            <SolidColorBrush x:Key="Button.MouseOver.Border" Color="#FFFFFFFF"/>
            <SolidColorBrush x:Key="Button.Pressed.Background" Color="#FFC4E5F6"/>
            <SolidColorBrush x:Key="Button.Pressed.Border" Color="#FF2C628B"/>
            <SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/>
            <SolidColorBrush x:Key="Button.Disabled.Border" Color="#FFADB2B5"/>
            <SolidColorBrush x:Key="Button.Disabled.Foreground" Color="#FF838383"/>
            <Style x:Key="CustomButton" TargetType="{x:Type Button}">
                <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
                <Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
                <Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/>
                <Setter Property="Foreground" Value="#FFB3B5B1"/>
                <Setter Property="BorderThickness" Value="1"/>
                <Setter Property="HorizontalContentAlignment" Value="Center"/>
                <Setter Property="VerticalContentAlignment" Value="Center"/>
                <Setter Property="Padding" Value="1"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
                                <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsDefaulted" Value="true">
                                    <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                                </Trigger>
                                <Trigger Property="IsMouseOver" Value="true">
                                    <Setter Property="Background" TargetName="border" Value="{StaticResource Button.MouseOver.Background}"/>
                                    <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}"/>
                                </Trigger>
                                <Trigger Property="IsPressed" Value="true">
                                    <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/>
                                    <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/>
                                </Trigger>
                                <Trigger Property="IsEnabled" Value="false">
                                    <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
                                    <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
                                    <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </Grid.Resources>
        <Button Content="Your Content" Style="{DynamicResource CustomButton}"/>
    </Grid>

And I know probably what that looks like

 

giphy.gif

 

But here is the EASY way to do it:

 

1. Go into Visual Studio (probably Blend would work too)

2. Make a normal button

3. In the visual designer right click on the button then go to Edit Template-> Edit a Copy

4. Place it in the relevant resources section (e.g. in the top level grid if you want to use it everywhere)

5. Use the name wherever you want it, e.g. Template="{DynamicResource CustomButton}"

 

Note: I added FF in front of the 6 letter/number color code just because in the template that is the format that use. 

 

Note: You may want to change the IsPressed, etc as well to make it look better.




#139987 Flow Explanation?

Posted by HelloInsomnia on 14 April 2020 - 11:05 AM

From the link Pash provided to the wiki page: "The UI stat monitor is a live command, and it is always checking the value of the variable, list item or table cell assigned to it."




#139985 Problem Ubot Update

Posted by HelloInsomnia on 14 April 2020 - 10:39 AM

IIRC this just happens the first time, if you restart Ubot the Gmail/Trello stuff should work fine.

 

But regardless since you are getting an error you can report it in the tracker: http://tracker.ubotstudio.com/




#139960 Expression To Delete Everything In Txt From X To Y ?

Posted by HelloInsomnia on 09 April 2020 - 12:14 PM

You probably want this then:

set(#article,$replace regular expression("Title:
Bald Heads

Word Count:
253

Summary:
Over the ages, baldness has been considered a disease. Lately, it has also been followed as a fashion. However, greater numbers of people still feel that a head covered by hair is always more attractive than a bald one.


Keywords:
Bald, Bald Heads, Bald Women, Bald Men


Article Body:
Here is the article...","(?si)^title.+?body:\\n",""),"Global")



#139953 Expression To Delete Everything In Txt From X To Y ?

Posted by HelloInsomnia on 08 April 2020 - 10:11 AM

Replace regular expression using:

(?i)^start.+?status



#139848 Scrape Dokument-Names From A Folder

Posted by HelloInsomnia on 19 March 2020 - 12:02 PM

Here is a function with an example:

 

clear list(%files)
add list to list(%files,$list from text("19-0215458-test.pdf
20-0357896.pdf
20-035789620-035789620-035789620-0357896.pdf",$new line),"Delete","Global")
loop($list total(%files)) {
    set(#file,$next list item(%files),"Global")
    alert($GetFirstTenDigits(#file))
}
define $GetFirstTenDigits(#_text) {
    comment("Get all digits")
    set(#_digits,$replace regular expression(#_text,"[^0-9]+",$nothing),"Local")
    if($comparison($text length(#_digits),"< Less than",11)) {
        then {
            comment("If less than 11 then return")
            return(#_digits)
        }
        else {
            comment("Else return first 10 only")
            return($substring(#_digits,0,10))
        }
    }
}




#139770 Ultimate Ui - Create Beautiful Uis With Xaml, Datagrid, Metro & More!

Posted by HelloInsomnia on 03 March 2020 - 11:22 AM

This is probably closer to what you want:

plugin command("UltimateUI.dll", "UI Load XAML", "<TextBox x:Name=\"Log\" 
                 Height=\"200\" 
                 IsReadOnly=\"True\"
                 VerticalScrollBarVisibility=\"Auto\"/>", "False", "False", "False", "BaseLight", "Blue")
clear list(%log)
loop(20) {
    add item to list(%log,"{$date} - {$random text($rand(30,50))}","Don\'t Delete","Global")
    plugin command("UltimateUI.dll", "UI Set TextBox Property", "Text", "Log", %log)
    wait(1)
}



#139716 Regarding Content Locking Like Say You Want To Do A Facebook Like

Posted by HelloInsomnia on 15 February 2020 - 04:59 PM

I think I've seen this on websites before as a content locking method. You may be able to find a script for it and then see what they do to make a ubot version. e.g. https://codecanyon.n...rdpress/2221015




#139593 Merging 10 List Items Into One Single Item

Posted by HelloInsomnia on 31 January 2020 - 11:36 AM

clear list(%items)
add list to list(%items,$list from text("Instant Loss: Eat Real, Lose Weight: How I Lost 125 Pounds—Includes 100+ Recipes
Lose Weight Without Dieting
Happy Gut: The Cleansing Program to Help You Lose Weight",$new line),"Delete","Global")
set(#text,$text from list(%items," "),"Global")



#139571 Ultimate Ui - Create Beautiful Uis With Xaml, Datagrid, Metro & More!

Posted by HelloInsomnia on 29 January 2020 - 10:57 AM

still waiting for sort row/colomn in datagrid

i hope its will available in next update

Thanks
 

 

An update is being pushed right now so it won't be in this one but I'll see what I can do about this since the datagrid is customized its not so simple as push the header and it auto sorts. But I think I can do it while also adding filtering at the same time.


Update V 1.10
 
Added:
  • Add DataGrid Button Column
  • DataGrid Button Cell
These functions can be used on the DataGrid to add a button column. The buttons will be created for each row on the DataGrid and you can run a command from the button.
 
In order to use this you will want to get the selected row index of the datagrid - which will be the row the button was clicked. Use the function Get DataGrid Selected Index for this. From there you can get the necessary data using the function Get DataGrid Row.
 



#139553 Browser User Agents List ?

Posted by HelloInsomnia on 28 January 2020 - 03:30 PM

Here: https://techblog.wil...on-user-agents/

 

There is a textbox at the bottom for easy copying.




#139514 Regex To Remove Specific Words From Single List Item

Posted by HelloInsomnia on 21 January 2020 - 10:34 AM

To remove well- from well-written:

(?i)(\b(of|it|well)['a-zA-Z]*[\s\,\;]*-?|\s(of|it|well)['a-zA-Z]*(?=\.))



#139430 Ultimate Ui - Create Beautiful Uis With Xaml, Datagrid, Metro & More!

Posted by HelloInsomnia on 15 January 2020 - 10:45 AM

Somebody asked me in PM for an example on how to change images based on dropdown, I am going to post the example I sent so others can benefit:

set(#image0,"https://www.aspicyperspective.com/wp-content/uploads/2013/05/IMG_8786-256x256.jpg","Global")
set(#image1,"https://www.aspicyperspective.com/wp-content/uploads/2016/12/snickerdoodle-sandwich-cookies-9-256x256.jpg","Global")
plugin command("UltimateUI.dll", "UI Load XAML", "<DockPanel>
            <ComboBox x:Name=\"selectImageComboBox\" 
                      DockPanel.Dock=\"Top\"
                      SelectedIndex=\"0\">
                <ComboBoxItem Content=\"Image 1\"/>
                <ComboBoxItem Content=\"Image 2\"/>
            </ComboBox>
            <Image x:Name=\"selectedImage\"
                   Width=\"256\"
                   Height=\"256\"/>
        </DockPanel>", "False", "False", "False", "BaseLight", "Blue")
ChangeImage()
plugin command("UltimateUI.dll", "UI Add ComboBox Event", "SelectionChanged", "selectImageComboBox", "ChangeImage")
define ChangeImage {
    if($comparison($plugin function("UltimateUI.dll", "$UI Get ComboBox Property", "SelectedIndex", "selectImageComboBox"),"=",0)) {
        then {
            plugin command("UltimateUI.dll", "UI Set Image Property", "Source", "selectedImage", #image0)
        }
        else {
            plugin command("UltimateUI.dll", "UI Set Image Property", "Source", "selectedImage", #image1)
        }
    }
}



#139362 Elite Ubot Plugin - Charts, Dialogs, Flow, File, Window Commands And More

Posted by HelloInsomnia on 08 January 2020 - 11:51 AM

somewhat like drag and drop the point in the graph to set the value.

 

Not sure about this one I'd have to look into it.