小编Dan*_*Dan的帖子

Eclipse 中用于 C++ 的 Visual Studio 工具链

我为 Java 安装了 Eclipse Neon.2,但是,我正在处理一个涉及 JNI 的项目,所以我不得不为 C++ 设置 Eclipse。要做到这一点,我下载了Development Tools for C++Help -> Install New Software。我的问题是没有toolchains可用于我的 C++ 项目。

一些网站和 YouTube 视频表明有一个 Microsoft Visual C++ 工具链可用,例如这个SO 问题和这个视频,但我没有成功。

是否有我可能错过的设置阶段或插件导致它未列出?

设置
Windows 10
Eclipse Neon.2
Microsoft Visual Studio Enterprise 2017 RC

c++ eclipse eclipse-plugin toolchain

5
推荐指数
2
解决办法
4634
查看次数

XAML TabControl边界问题

我试图制作一个TabControl支持滚动的自定义,但保持原始的外观和感觉TabControl,显然除了它滚动.

首先,我选择编辑所用原始模板的副本TabControl.

然后我把ScrollViewer周围TabPanel.但是,这会导致一个小问题,即选中时标签现在在其底部有一个边框.通过比较图像中的法线TabControl和样式TabControl,可以看到这一点.

起初我假设这是滚动查看器的z索引,但在尝试不同的值并确保滚动查看器的z索引并且TabPanel明显高于Border'sz索引之后,它没有任何区别.

如果选中的选项卡底部没有边框,如何将其包裹在ScrollViewer?中,我怎样才能达到相同的效果?

在此输入图像描述


MainWindow.xaml

<Window x:Class="ScrollableTabControl.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Window.Resources>
        <SolidColorBrush x:Key="TabItem.Selected.Background" Color="#FFFFFF"/>
        <SolidColorBrush x:Key="TabItem.Selected.Border" Color="#ACACAC"/>
        <Style x:Key="TabControlStyle1" TargetType="{x:Type TabControl}">
            <Setter Property="Padding" Value="2"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Background" Value="{StaticResource TabItem.Selected.Background}"/>
            <Setter Property="BorderBrush" Value="{StaticResource TabItem.Selected.Border}"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type TabControl}">
                        <Grid x:Name="templateRoot" …
Run Code Online (Sandbox Code Playgroud)

c# wpf xaml border

5
推荐指数
1
解决办法
169
查看次数

没有焦点的ComboBoxItem

我正在处理ComboBox通常包含大量数据的元素; ~250000个数据条目.

当a ComboBox设置有点像这样时,这很好用.

<ComboBox ItemsSource="{Binding Items}">
    <ComboBox.ItemsPanel>
        <ItemsPanelTemplate>
            <VirtualizingStackPanel />
        </ItemsPanelTemplate>
    </ComboBox.ItemsPanel>
</ComboBox>
Run Code Online (Sandbox Code Playgroud)

但是,ComboBox我正在使用的一些自定义修改要求ComboBoxItem元素不可聚焦.我通过使用中的setter实现了这一点ComboBox.ItemContainerStyle.

<ComboBox ItemsSource="{Binding Items}">
    <ComboBox.ItemsPanel>
        <ItemsPanelTemplate>
            <VirtualizingStackPanel />
        </ItemsPanelTemplate>
    </ComboBox.ItemsPanel>
    <ComboBox.ItemContainerStyle>
        <Style TargetType="ComboBoxItem">
            <Setter
                Property="Focusable"
                Value="False" />
        </Style>
    </ComboBox.ItemContainerStyle>
</ComboBox>
Run Code Online (Sandbox Code Playgroud)

但这有一个问题.它可以正常工作,直到选择了一个对象.然后当用户ComboBox再次尝试打开时,它会使程序崩溃.

我的问题是,如何ComboBox设置所有ComboBoxItem元素都不可调焦,但它不会使程序崩溃.


问题的GIF


示例代码

XAML

<Window x:Class="FocusableTest.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
        Title="MainWindow"
        Height="450"
        Width="800">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="2*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="2*"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions> …
Run Code Online (Sandbox Code Playgroud)

c# wpf

5
推荐指数
2
解决办法
290
查看次数

获取蓝牙 COM 端口

我正在尝试访问有关蓝牙串行端口的特定信息。我能够在我的蓝牙设置中找到这个窗口,它向我显示蓝牙设备的端口、方向和名称(如果它与 COM 端口相关)。

在此输入图像描述

目前,为了尝试获取此信息,我一直在使用 WQL 来查询一些 Windows 管理类。

# I don't really mind if it is run in a Powershell environment
gwmi -query "SELECT * FROM Win32_PnPEntity WHERE Name LIKE '%COM%' AND PNPDeviceID LIKE '%BTHENUM%' AND PNPClass = 'Ports'"

//or a C# environment
ManagementObjectCollection results = new ManagementObjectSearcher("SELECT * FROM Win32_PnPEntity WHERE Name LIKE '%COM%' AND PNPDeviceID LIKE 'USB%' AND PNPClass = 'Ports'").Get();

#This is a lot slower but it gets a bit more information about the serial ports
gwmi …
Run Code Online (Sandbox Code Playgroud)

c# powershell bluetooth wmi-query wql

4
推荐指数
1
解决办法
3227
查看次数

在css中使用ttf文件

据我所知,使用自定义字体,在这种情况下本地存储,你会使用类似的东西.

@font-face {
    font-family: 'theFontFamily';
    src local('the font'),
        local('the-font'),
        url(path/to/the-font);
}

.fontClass {
    font-family: 'theFontFamily', extra_settings;
}
Run Code Online (Sandbox Code Playgroud)

所以在本地使用这种字体,你会期望这个吗?

@font-face {
  font-family: 'Pacifico';
  src: local('Pacifico Regular'),
       local('Pacifico-Regular'),
       url(resources/fonts/Pacifico.ttf);
}

.logo-container {
  font-family: 'Pacifico', cursive;
}
Run Code Online (Sandbox Code Playgroud)

当我尝试它时,代码更改字体,而不是所需的字体.看起来像这样.

在此输入图像描述

而如果我使用导入链接<link href="https://fonts.googleapis.com/css?family=Pacifico" rel="stylesheet">,只需使用以下代码即可.

.logo-container {
  font-family: 'Pacifico', cursive;
}
Run Code Online (Sandbox Code Playgroud)

这看起来像这样.

在此输入图像描述

我可能犯了一个简单的错误,如果有人能够帮助我解决这个问题,我将不胜感激.

html css fonts webfonts font-face

3
推荐指数
1
解决办法
4921
查看次数

htaccess在包含HTTP 451的参数时"中断"

对于我的网页,我有一个.htaccess看起来像这样的文档

<Files .htaccess>
order allow,deny
deny from all
</Files>

ErrorDocument 404 /websites/404/index.php
Run Code Online (Sandbox Code Playgroud)

现在据我所知,你可以ErrorDocument通过添加另一行来进一步包括.例如

<Files .htaccess>
order allow,deny
deny from all
</Files>

ErrorDocument 404 /websites/404/index.php
ErrorDocument 503 /websites/maintenance/index.php
Run Code Online (Sandbox Code Playgroud)

但是,当我尝试使用以下代码行为HTTP 451添加页面时ErrorDocument 451 /websites/451/index.php,我重新加载页面,我得到了一个Server error! Error 500.我后来发现这是因为XAMPP不再拿起文件夹中的.htaccess文件夹,错误只能通过删除ErrorDocumentfor 来解决error 451.造成这种情况的原因是什么?如何解决?


注意:
我还发现,出现这种情况的error 418: I'm a teapot,以及


编辑
只是为了包含有关我正在使用的软件的更多信息.我在用

  • XAMPP控制面板v3.2.2
  • Apache 2.4.17 - 这是XAMPP附带的版本

html php .htaccess

3
推荐指数
1
解决办法
348
查看次数

场景变化后保持舞台最大化

当我使用以下代码更改舞台上的场景时,我的舞台会改变大小。然而,右上角的最大化/最小化窗口的按钮表示舞台仍然最大化,即使它显然不是。

当场景发生变化时,我如何能够保持舞台最大化?

import javafx.application.Application;
import javafx.concurrent.Task;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.ScrollPane;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.scene.text.Font;
import javafx.stage.Stage;

public class Program2 extends Application {
    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) {
        try {
            StackPane p = new StackPane();
            primaryStage.setTitle("Chart Application");
            Label loader = new Label("Loading...");
            loader.setGraphic(new ImageView(new Image("https://media.giphy.com/media/FmcNeI0PnsAKs/giphy.gif")));
            loader.setFont(new Font(35));
            p.setStyle("-fx-background: #FFFFFF;");
            p.getChildren().add(loader);
            StackPane.setAlignment(loader, Pos.CENTER);

            primaryStage.setScene(new Scene(p));
            primaryStage.setMaximized(true);

            Task<VBox> task = new Task<VBox>() {
                @Override …
Run Code Online (Sandbox Code Playgroud)

java javafx javafx-8

3
推荐指数
1
解决办法
601
查看次数

更新word中的目录

我的 Word 文档有一个宏,旨在更新所有字段和所有目录。

Sub UpdateFields()
    Dim oStory As Range
    For Each oStory In ActiveDocument.StoryRanges
        oStory.Fields.Update
        If oStory.StoryType <> wdMainTextStory Then
            While Not (oStory.NextStoryRange Is Nothing)
                Set oStory = oStory.NextStoryRange
                oStory.Fields.Update
            Wend
        End If
    Next oStory
    Set oStory = Nothing

    Dim TOC As TableOfContents
    For Each TOC In ActiveDocument.TablesOfContents
        TOC.Update
    Next
End Sub
Run Code Online (Sandbox Code Playgroud)

但是,当它运行时,我收到此错误。

在此输入图像描述
错误然后在下面进行调试,
我将不胜感激解决问题的任何帮助。

vba ms-word

3
推荐指数
1
解决办法
5098
查看次数

向 java 添加新库

我正在尝试使用Apache Commons中名为 StringUtils 的功能。但是,这需要您下载库并添加它,以便我可以使用该代码import org.apache.commons.lang3.StringUtils;。我的问题是我不确定将其添加到哪里,以便我可以在命令提示符下编译我的程序。我也不知道应该将哪些文件添加到所需的文件夹中。

任何帮助将不胜感激。

java apache-commons

2
推荐指数
1
解决办法
4220
查看次数

自定义TableHeaderUI中断自定义TableRowSorter

我写了一个自定义TableRowSorter,当你点击JTableHeaderfrom
SortOrder.UNSORTED=> SortOrder.ASCENDING=> SortOrder.DESCENDING=> SortOrder.ASCENDING=> SortOrder.DESCENDING=> ...
to
SortOrder.UNSORTED=> SortOrder.ASCENDING=> SortOrder.DESCENDING=> SortOrder.UNSORTED=> SortOrder.ASCENDING=> SortOrder.DESCENDING=> 时,它会改变排序顺序...

ADU_SortOrder.java

package order;

import java.util.ArrayList;
import java.util.List;

import javax.swing.SortOrder;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;

public class ADU_SortOrder<M extends TableModel> extends TableRowSorter<M> {
    public ADU_SortOrder(M model) {
        setModel(model);
    }

    boolean firstTime = true; //Needed in case there are any initial sort keys
    int columnHolder = -1;

    @Override
    public void toggleSortOrder(int column) { …
Run Code Online (Sandbox Code Playgroud)

java sorting swing jtable jtableheader

2
推荐指数
1
解决办法
101
查看次数