Giter VIP home page Giter VIP logo

core's Introduction

TANGRAM

Join the chat at https://gitter.im/TangramDev/Lobby forum

โ˜€๏ธ Tangram is preparing, please wait.

Contents

Tangram is a desktop software glue. Unlike traditional programming language bridges, it focuses on connections at the graphical interface layer. Tangram can only be used in the Windows desktop environment, but this limitation may be broken in the future.

Tangram is aware of a common scenario in Windows development. A pair of size-associated windows, the size of the child window is only controlled by the parent window. At this point, Tangram can add new elements to the program by changing the relationship between the windows. And it all happens at runtime. This turns a program that could only be modified at compile time into a container that can be changed at any time.

In order to organize the newly added elements. Tangram uses a nested grid structure for layout. All newly added elements are placed in this grid structure.

Sketch1

Due to the hot update feature of Tangram. Tangram can instantly change the layout of the window. It is not restricted by the original program.

Sketch2

Attached elements

Almost all user interface elements based on Win32 implementation can be added to the program as new elements by Tangram. This includes COM components, Microsoft.NET user controls, Java SWT controls, web pages, and so forth.

Layout XML

For complex layouts, Tangram uses a special XML format to describe it. You can read the Layout Guide for detailed syntax.

Tangram's original idea was a UI fusion technology under the Windows platform. Because Tangram works on the Win32 layer. It supports almost all UI technologies on Windows. Includes C++/COM, .NET, WPF, UWP and Java GUI. But with the advancement of Microsoft technology, the next generation of Win32 applications and UWP applications have the opportunity to enter the ARM platform. This includes IOS and Android (Microsoft Launcher). We also hope to introduce the Tangram UI fusion technology to more software and hardware platforms. At the same time, cross-platform technologies such as Xarmarin and Chromium Aura UI have matured. We also hope that Tangram will gradually support them.

Reference link:

Tangram has created a new software build model. Please read the Software Lifecycle.

Microsoft Office 2016

[1]

Visual Studio 2017

[2]

Eclipse Workbench

[3]

Google Chromium

[4]

Learn how to

Other important links

System requirements

Microsoft Visual Studio 2017

Necessary installation options

  • .NET desktop development
  • Desktop development with C++
    • Visual C++ MFC for x86 and x64
    • C++/CLI support
  • Office/SharePoint development
  • Microsoft Visual Studio 2017 Installer Projects

Windows 10

Download source code

git clone --recurse-submodules https://github.com/TangramDev/Tangram.git

Copy Codejock Software into {{Tangram Root Directory}}\ThirdParty\Codejock Software

Compile

Please run Visual Studio as an administrator.

Tangram depends on Microsoft CPPRESTSDK, You need to compile it first.

Open {{Tangram Root Directory}}\ThirdParty\cpprestsdk\cpprestsdk141.sln, use different configurations(Debug/Release - x86/x64) to build cpprest141.static.

Open {{Tangram Root Directory}}\Build\Tangram.sln, build Tangram and TangramCLR.

First, open {{Tangram Root Directory}}\Build\Tangram.sln, build Samples > SimpleNetComponent and get library file SimpleNetComponent.dll. This will be the first new element we use to extend.

Then build and run project Samples > SimpleWin32Application. You will see

Capture1

This is a Win32 desktop application, but a UserControl developed by Microsoft.NET is placed on the left side of the window. Back in the code, we manually created a paire of dimension-related windows hWnd and hChildHWnd.

HWND hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
  CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, nullptr, nullptr, hInstance, nullptr);

if (!hWnd)
{
  return FALSE;
}

ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);

RECT rc;
::GetClientRect(hWnd, &rc);
hChildHWnd = CreateWindowW(szWindowClass2, TEXT("Child Window"),
   WS_CHILDWINDOW | WS_VISIBLE | WS_CLIPSIBLINGS, 0, 0,
   rc.right - rc.left, rc.bottom - rc.top, hWnd, NULL, hInstance, NULL);

ShowWindow(hChildHWnd, nCmdShow);
UpdateWindow(hWnd);

We register them in the Tangram system with the code below.

// COM initialization
::OleInitialize(nullptr);

// Get the global Tangram object
CComPtr<ITangram> ppTangram;
ppTangram.CoCreateInstance(L"tangram.tangram");
ITangram* pTangram = ppTangram.Detach();

if (pTangram)
{
   CComPtr<IWndPage> pPage;
   pTangram->CreateWndPage((LONGLONG)hWnd, &pPage);
   if (pPage)
   {
       CComPtr<IWndFrame> pFrame;
       pPage->CreateFrame(CComVariant((LONGLONG)hWnd),
           CComVariant((LONGLONG)hChildHWnd), BSTR(L"First Frame"), &pFrame);
       if (pFrame) {
           CComPtr<IWndNode> pNode;
           pFrame->Extend(BSTR(L"First Node"), BSTR(L"SimpleWin32Application.xml"), &pNode);
       }
   }
}

Tangram is designed as a COM component. You can create it using the ::CoCreateInstance function. Alternatively, you can use it as a dynamic link library and load it using the ::LoadLibrary function.

Note that the above code loads a SimpleWin32Application.xml file. Open this file

<tangram>
  <window>
    <node id='splitter' name='view' rows='1' cols='2' width='100,100' height='100' middlecolor='RGB(255,255,255)'>
      <node name='node1' id='CLRCtrl' cnnid='SimpleNetComponent.UserControl1, SimpleNetComponent, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' caption='node1'/>
      <node name='hostview' caption='host' id='hostview' />
    </node>
  </window>
</tangram>

In Tangram, we call such files a layout file. These files tell Tangram how to extend a window. Includes interface layout and extended element types.

We think that Tangram is a great idea, but now we are understaffed. We urgently need more developers to participate in our work. If you are interested in changing the world with us, please contact us.

core's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.